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

View file

@ -1476,7 +1476,7 @@ en:
dispositions: dispositions:
agreed: "agreed" agreed: "agreed"
disagreed: "disagreed" disagreed: "disagreed"
defered: "deferred" deferred: "deferred"
flagged_by: "Flagged by" flagged_by: "Flagged by"
resolved_by: "Resolved 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: "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." 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." disagreed: "Danke für deine Meldung. Wir sehen uns das an."
defered: "Danke für deine Meldung. Wir sehen uns das an." deferred: "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_and_deleted: "Danke für deine Meldung. Wir haben den Beitrag gelöscht."
system_messages: system_messages:
post_hidden: post_hidden:
subject_template: "Beitrag wegen Meldungen aus der Community versteckt" 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: "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." 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." disagreed: "Thanks for letting us know. We're looking into it."
defered: "Thanks for letting us know. We're looking into it." deferred: "Thanks for letting us know. We're looking into it."
defered_and_deleted: "Thanks for letting us know. We've removed the post." deferred_and_deleted: "Thanks for letting us know. We've removed the post."
system_messages: system_messages:
post_hidden: 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: "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." 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." disagreed: "Gracias por hacérnoslo saber. Estamos revisándolo."
defered: "Gracias por hacérnoslo saber. Estamos revisándolo." deferred: "Gracias por hacérnoslo saber. Estamos revisándolo."
defered_and_deleted: "Gracias por hacérnoslo saber. Hemos eliminado el post." deferred_and_deleted: "Gracias por hacérnoslo saber. Hemos eliminado el post."
system_messages: system_messages:
post_hidden: post_hidden:
subject_template: "Post oculto al haber sido reportado por la comunidad" 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: "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." 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." disagreed: "Merci de nous en informer. Nous travaillons à sa résolution."
defered: "Merci de nous en informer. Nous travaillons à sa résolution." deferred: "Merci de nous en informer. Nous travaillons à sa résolution."
defered_and_deleted: "Merci de nous en informer. Nous avons supprimé le message." deferred_and_deleted: "Merci de nous en informer. Nous avons supprimé le message."
system_messages: system_messages:
post_hidden: post_hidden:
subject_template: "Message caché suite à un signalement par la communauté" subject_template: "Message caché suite à un signalement par la communauté"

View file

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

View file

@ -1037,8 +1037,8 @@ zh_CN:
agreed: "感谢通知我们。我们认为这是一个问题,并且我们正在了解情况。" agreed: "感谢通知我们。我们认为这是一个问题,并且我们正在了解情况。"
agreed_and_deleted: "感谢通知我们。我们认为这是一个问题,并且我们已经删除了帖子。" agreed_and_deleted: "感谢通知我们。我们认为这是一个问题,并且我们已经删除了帖子。"
disagreed: "感谢通知我们。我们正在了解情况。" disagreed: "感谢通知我们。我们正在了解情况。"
defered: "感谢通知我们。我们正在了解情况。" deferred: "感谢通知我们。我们正在了解情况。"
defered_and_deleted: "感谢通知我们。我们已经删除了帖子。" deferred_and_deleted: "感谢通知我们。我们已经删除了帖子。"
system_messages: system_messages:
post_hidden: post_hidden:
subject_template: "%{site_name} 提示:由于论坛用户标记,系统隐藏了您的帖子" 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" if filter == "old"
post_actions.where("post_actions.disagreed_at IS NOT NULL OR 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") post_actions.agreed_at IS NOT NULL")
else else
post_actions.active post_actions.active

View file

@ -129,7 +129,7 @@ describe LeaderRequirements do
end end
deferred_flags = [:off_topic, :inappropriate, :notify_user, :notify_moderators, :spam].map do |t| 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 end
deleted_flags = [:off_topic, :inappropriate, :notify_user, :notify_moderators, :spam].map do |t| deleted_flags = [:off_topic, :inappropriate, :notify_user, :notify_moderators, :spam].map do |t|