fixes for upgrade schema script
This commit is contained in:
@@ -292,7 +292,7 @@ class Post < ActiveRecord::Base
|
||||
raise PostFlag::Error.new("Post is locked and cannot be flagged")
|
||||
end
|
||||
|
||||
flag = flags.create(:reason => reason)
|
||||
flag = flags.create(:reason => reason, :is_resolved => false)
|
||||
|
||||
if flag.errors.any?
|
||||
raise PostFlag::Error.new(flag.errors.full_messages.join("; "))
|
||||
|
||||
@@ -343,7 +343,7 @@ class Tag < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def should_update_related?
|
||||
related_tags.blank? || related_tags_updated_at < related_cache_expiry.hours.ago
|
||||
related_tags.blank? || related_tags_updated_at.blank? || related_tags_updated_at < related_cache_expiry.hours.ago
|
||||
end
|
||||
|
||||
def related_tag_array
|
||||
|
||||
@@ -26,7 +26,6 @@ class User < ActiveRecord::Base
|
||||
validates_confirmation_of :password
|
||||
validates_presence_of :email, :if => lambda {|rec| rec.new_record? && Danbooru.config.enable_email_verification?}
|
||||
validate :validate_ip_addr_is_not_banned, :on => :create
|
||||
before_validation :convert_blank_email_to_null
|
||||
before_validation :normalize_blacklisted_tags
|
||||
before_create :encrypt_password_on_create
|
||||
before_update :encrypt_password_on_update
|
||||
@@ -303,12 +302,6 @@ class User < ActiveRecord::Base
|
||||
raise User::Error.new("Verification key does not match")
|
||||
end
|
||||
end
|
||||
|
||||
def convert_blank_email_to_null
|
||||
if email.blank?
|
||||
self.email = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
module BlacklistMethods
|
||||
|
||||
Reference in New Issue
Block a user