TRIVIAL: fix grammar on 'deferred' columns

This commit is contained in:
Régis Hanol 2014-08-11 11:56:54 +02:00
parent 45faf07ba6
commit 85570ddc77
11 changed files with 31 additions and 25 deletions

View File

@ -18,24 +18,24 @@ class PostAction < ActiveRecord::Base
scope :spam_flags, -> { where(post_action_type_id: PostActionType.types[:spam]) }
scope :flags, -> { where(post_action_type_id: PostActionType.notify_flag_type_ids) }
scope :publics, -> { where(post_action_type_id: PostActionType.public_type_ids) }
scope :active, -> { where(disagreed_at: nil, defered_at: nil, agreed_at: nil, deleted_at: nil) }
scope :active, -> { where(disagreed_at: nil, deferred_at: nil, agreed_at: nil, deleted_at: nil) }
after_save :update_counters
after_save :enforce_rules
after_commit :notify_subscribers
def disposed_by_id
disagreed_by_id || agreed_by_id || defered_by_id
disagreed_by_id || agreed_by_id || deferred_by_id
end
def disposed_at
disagreed_at || agreed_at || defered_at
disagreed_at || agreed_at || deferred_at
end
def disposition
return :disagreed if disagreed_at
return :agreed if agreed_at
return :defered if defered_at
return :deferred if deferred_at
nil
end
@ -144,11 +144,11 @@ class PostAction < ActiveRecord::Base
.where(post_action_type_id: PostActionType.flag_types.values)
actions.each do |action|
action.defered_at = Time.zone.now
action.defered_by_id = moderator.id
action.deferred_at = Time.zone.now
action.deferred_by_id = moderator.id
# so callback is called
action.save
action.add_moderator_post_if_needed(moderator, :defered, delete_post)
action.add_moderator_post_if_needed(moderator, :deferred, delete_post)
end
update_flagged_posts_count
@ -421,7 +421,7 @@ class PostAction < ActiveRecord::Base
end
def self.post_action_type_for_post(post_id)
post_action = PostAction.find_by(defered_at: nil, post_id: post_id, post_action_type_id: PostActionType.flag_types.values, deleted_at: nil)
post_action = PostAction.find_by(deferred_at: nil, post_id: post_id, post_action_type_id: PostActionType.flag_types.values, deleted_at: nil)
PostActionType.types[post_action.post_action_type_id]
end
@ -447,11 +447,11 @@ end
# deleted_by_id :integer
# related_post_id :integer
# staff_took_action :boolean default(FALSE), not null
# defered_by_id :integer
# deferred_by_id :integer
# targets_topic :boolean default(FALSE)
# agreed_at :datetime
# agreed_by_id :integer
# defered_at :datetime
# deferred_at :datetime
# disagreed_at :datetime
# disagreed_by_id :integer
#

View File

@ -1476,7 +1476,7 @@ en:
dispositions:
agreed: "agreed"
disagreed: "disagreed"
defered: "deferred"
deferred: "deferred"
flagged_by: "Flagged by"
resolved_by: "Resolved by"

View File

@ -1069,8 +1069,8 @@ de:
agreed: "Danke, dass du uns Bescheid gegeben hast. Wir sind auch der Meinung, dass es ein Problem gibt und sehen uns das an."
agreed_and_deleted: "Danke, dass du uns Bescheid gegeben hast. Wir waren auch der Meinung, dass es ein Problem gibt und haben den Beitrag gelöscht."
disagreed: "Danke für deine Meldung. Wir sehen uns das an."
defered: "Danke für deine Meldung. Wir sehen uns das an."
defered_and_deleted: "Danke für deine Meldung. Wir haben den Beitrag gelöscht."
deferred: "Danke für deine Meldung. Wir sehen uns das an."
deferred_and_deleted: "Danke für deine Meldung. Wir haben den Beitrag gelöscht."
system_messages:
post_hidden:
subject_template: "Beitrag wegen Meldungen aus der Community versteckt"

View File

@ -1218,8 +1218,8 @@ en:
agreed: "Thanks for letting us know. We agree there is an issue and we're looking into it."
agreed_and_deleted: "Thanks for letting us know. We agree there is an issue and we've removed the post."
disagreed: "Thanks for letting us know. We're looking into it."
defered: "Thanks for letting us know. We're looking into it."
defered_and_deleted: "Thanks for letting us know. We've removed the post."
deferred: "Thanks for letting us know. We're looking into it."
deferred_and_deleted: "Thanks for letting us know. We've removed the post."
system_messages:
post_hidden:

View File

@ -1018,8 +1018,8 @@ es:
agreed: "Gracias por avisarnos. Coincidimos con tu reporte en que hay un problema y lo estamos revisando."
agreed_and_deleted: "Gracias por avisarnos. Coincidimos con tu reporte en que hay un problema y hemos quitado el post."
disagreed: "Gracias por hacérnoslo saber. Estamos revisándolo."
defered: "Gracias por hacérnoslo saber. Estamos revisándolo."
defered_and_deleted: "Gracias por hacérnoslo saber. Hemos eliminado el post."
deferred: "Gracias por hacérnoslo saber. Estamos revisándolo."
deferred_and_deleted: "Gracias por hacérnoslo saber. Hemos eliminado el post."
system_messages:
post_hidden:
subject_template: "Post oculto al haber sido reportado por la comunidad"

View File

@ -1066,8 +1066,8 @@ fr:
agreed: "Merci de nous en informer. Nous sommes en accord avec votre signalement et nous travaillons à sa résolution."
agreed_and_deleted: "Merci de nous en informer. Nous sommes en accord avec votre signalement et avons supprimé le message."
disagreed: "Merci de nous en informer. Nous travaillons à sa résolution."
defered: "Merci de nous en informer. Nous travaillons à sa résolution."
defered_and_deleted: "Merci de nous en informer. Nous avons supprimé le message."
deferred: "Merci de nous en informer. Nous travaillons à sa résolution."
deferred_and_deleted: "Merci de nous en informer. Nous avons supprimé le message."
system_messages:
post_hidden:
subject_template: "Message caché suite à un signalement par la communauté"

View File

@ -1038,8 +1038,8 @@ he:
agreed: "תודה שעדכנת אותנו. אנחנו מסכימים שיש כאן בעיה ואנחנו מנסים לבדוק את העניין."
agreed_and_deleted: "תודה שעדכנת אותנו. אנחנו מסכימים שישנה בעיה והסרנו את הפרסום."
disagreed: "תודה שעדכנת אותנו. אנחנו בודקים את זה."
defered: "תודה שעדכנת אותנו. אנחנו בודקים את בזה."
defered_and_deleted: "תודה שעדכנת אותנו. הסרנו את הפרסום."
deferred: "תודה שעדכנת אותנו. אנחנו בודקים את בזה."
deferred_and_deleted: "תודה שעדכנת אותנו. הסרנו את הפרסום."
system_messages:
post_hidden:
subject_template: "הודעה הוסתרה בעקבות סימון"

View File

@ -1037,8 +1037,8 @@ zh_CN:
agreed: "感谢通知我们。我们认为这是一个问题,并且我们正在了解情况。"
agreed_and_deleted: "感谢通知我们。我们认为这是一个问题,并且我们已经删除了帖子。"
disagreed: "感谢通知我们。我们正在了解情况。"
defered: "感谢通知我们。我们正在了解情况。"
defered_and_deleted: "感谢通知我们。我们已经删除了帖子。"
deferred: "感谢通知我们。我们正在了解情况。"
deferred_and_deleted: "感谢通知我们。我们已经删除了帖子。"
system_messages:
post_hidden:
subject_template: "%{site_name} 提示:由于论坛用户标记,系统隐藏了您的帖子"

View File

@ -0,0 +1,6 @@
class RenameDeferedColumnsOnPostAction < ActiveRecord::Migration
def change
rename_column :post_actions, :defered_by_id, :deferred_by_id
rename_column :post_actions, :defered_at, :deferred_at
end
end

View File

@ -115,7 +115,7 @@ module FlagQuery
if filter == "old"
post_actions.where("post_actions.disagreed_at IS NOT NULL OR
post_actions.defered_at IS NOT NULL OR
post_actions.deferred_at IS NOT NULL OR
post_actions.agreed_at IS NOT NULL")
else
post_actions.active

View File

@ -129,7 +129,7 @@ describe LeaderRequirements do
end
deferred_flags = [:off_topic, :inappropriate, :notify_user, :notify_moderators, :spam].map do |t|
Fabricate(:flag, post: Fabricate(:post, user: user), post_action_type_id: PostActionType.types[t], defered_at: 1.minute.ago)
Fabricate(:flag, post: Fabricate(:post, user: user), post_action_type_id: PostActionType.types[t], deferred_at: 1.minute.ago)
end
deleted_flags = [:off_topic, :inappropriate, :notify_user, :notify_moderators, :spam].map do |t|