From e9b877f326056fa110f19069588a0561c917546a Mon Sep 17 00:00:00 2001 From: r888888888 Date: Wed, 17 Jul 2013 15:32:46 -0700 Subject: [PATCH 1/3] fixes #1858 --- app/views/pools/new.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/pools/new.html.erb b/app/views/pools/new.html.erb index 1c379f680..b9280948d 100644 --- a/app/views/pools/new.html.erb +++ b/app/views/pools/new.html.erb @@ -4,11 +4,11 @@

New Pool

<%= f.input :name, :as => :string %> <%= dtext_field "pool", "description" %> - <%= dtext_preview_button "pool", "description" %> <%= f.input :post_ids, :label => "Posts" %> <%= f.input :category, :collection => ["series", "collection"], :include_blank => false %> <%= f.input :is_active %> - <%= f.button :submit %> + <%= f.button :submit, "Submit" %> + <%= dtext_preview_button "pool", "description" %> <% end %> From f017a0ee111df22b352fa3cc117f5b959257832f Mon Sep 17 00:00:00 2001 From: r888888888 Date: Thu, 18 Jul 2013 16:01:17 -0700 Subject: [PATCH 2/3] fixes #1857 --- app/models/tag_alias.rb | 4 ++-- app/models/tag_implication.rb | 4 ++-- test/unit/current_user_test.rb | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/models/tag_alias.rb b/app/models/tag_alias.rb index f049b829f..21e0dd2fb 100644 --- a/app/models/tag_alias.rb +++ b/app/models/tag_alias.rb @@ -16,7 +16,7 @@ class TagAlias < ActiveRecord::Base end def active - where("status = ?", "active") + where("status IN (?)", ["active", "processing"]) end def search(params) @@ -62,7 +62,7 @@ class TagAlias < ActiveRecord::Base def self.to_aliased(names) Array(names).flatten.map do |name| Cache.get("ta:#{Cache.sanitize(name)}") do - ActiveRecord::Base.select_value_sql("select consequent_name from tag_aliases where status = 'active' and antecedent_name = ?", name) || name + ActiveRecord::Base.select_value_sql("select consequent_name from tag_aliases where status in ('active', 'processing') and antecedent_name = ?", name) || name end end.uniq end diff --git a/app/models/tag_implication.rb b/app/models/tag_implication.rb index 414d14e34..c60ff1b85 100644 --- a/app/models/tag_implication.rb +++ b/app/models/tag_implication.rb @@ -15,7 +15,7 @@ class TagImplication < ActiveRecord::Base module ClassMethods # assumes names are normalized def with_descendants(names) - (names + where("antecedent_name in (?) and status = ?", names, "active").map(&:descendant_names_array)).flatten.uniq + (names + where("antecedent_name in (?) and status in (?)", names, ["active", "processing"]).map(&:descendant_names_array)).flatten.uniq end end @@ -26,7 +26,7 @@ class TagImplication < ActiveRecord::Base until children.empty? all.concat(children) - children = TagImplication.where("antecedent_name IN (?) and status = ?", children, "active").all.map(&:consequent_name) + children = TagImplication.where("antecedent_name IN (?) and status in (?)", children, ["active", "processing"]).all.map(&:consequent_name) end end.sort.uniq end diff --git a/test/unit/current_user_test.rb b/test/unit/current_user_test.rb index 6d49a9ac1..796b96039 100644 --- a/test/unit/current_user_test.rb +++ b/test/unit/current_user_test.rb @@ -6,6 +6,10 @@ class CurrentUserTest < ActiveSupport::TestCase CurrentUser.ip_addr = nil end + teardown do + Thread.current[:safe_mode] = false + end + context ".safe_mode?" do should "return true if the host contains the string host" do req = mock(:host => "safebooru") From cad82aa7625a083b793c4f5f79953ce3290f477b Mon Sep 17 00:00:00 2001 From: r888888888 Date: Thu, 18 Jul 2013 16:19:11 -0700 Subject: [PATCH 3/3] fixes #1864 --- app/models/pool.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/pool.rb b/app/models/pool.rb index 308aacf0e..1713e622b 100644 --- a/app/models/pool.rb +++ b/app/models/pool.rb @@ -2,7 +2,7 @@ require 'ostruct' class Pool < ActiveRecord::Base validates_uniqueness_of :name - validates_format_of :name, :with => /\A[^\s;,]+\Z/, :on => :create, :message => "cannot have whitespace, commas, or semicolons" + validates_format_of :name, :with => /\A[^\s,]+\Z/, :on => :create, :message => "cannot have whitespace or commas" validates_inclusion_of :category, :in => %w(series collection) belongs_to :creator, :class_name => "User" belongs_to :updater, :class_name => "User"