diff --git a/app/models/post_action.rb b/app/models/post_action.rb index 292b5f60f..016a0d11f 100644 --- a/app/models/post_action.rb +++ b/app/models/post_action.rb @@ -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 # diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 5c32548a3..be017ffef 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -1476,7 +1476,7 @@ en: dispositions: agreed: "agreed" disagreed: "disagreed" - defered: "deferred" + deferred: "deferred" flagged_by: "Flagged by" resolved_by: "Resolved by" diff --git a/config/locales/server.de.yml b/config/locales/server.de.yml index e02f51dc8..125bf5fe3 100644 --- a/config/locales/server.de.yml +++ b/config/locales/server.de.yml @@ -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" diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 760e9d31a..4ad63a7de 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -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: diff --git a/config/locales/server.es.yml b/config/locales/server.es.yml index 5b8d72e8b..68d07c3d4 100644 --- a/config/locales/server.es.yml +++ b/config/locales/server.es.yml @@ -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" diff --git a/config/locales/server.fr.yml b/config/locales/server.fr.yml index 974c2236c..59178c426 100644 --- a/config/locales/server.fr.yml +++ b/config/locales/server.fr.yml @@ -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é" diff --git a/config/locales/server.he.yml b/config/locales/server.he.yml index ed1735a0a..9cfc4b834 100644 --- a/config/locales/server.he.yml +++ b/config/locales/server.he.yml @@ -1038,8 +1038,8 @@ he: agreed: "תודה שעדכנת אותנו. אנחנו מסכימים שיש כאן בעיה ואנחנו מנסים לבדוק את העניין." agreed_and_deleted: "תודה שעדכנת אותנו. אנחנו מסכימים שישנה בעיה והסרנו את הפרסום." disagreed: "תודה שעדכנת אותנו. אנחנו בודקים את זה." - defered: "תודה שעדכנת אותנו. אנחנו בודקים את בזה." - defered_and_deleted: "תודה שעדכנת אותנו. הסרנו את הפרסום." + deferred: "תודה שעדכנת אותנו. אנחנו בודקים את בזה." + deferred_and_deleted: "תודה שעדכנת אותנו. הסרנו את הפרסום." system_messages: post_hidden: subject_template: "הודעה הוסתרה בעקבות סימון" diff --git a/config/locales/server.zh_CN.yml b/config/locales/server.zh_CN.yml index 0ec4f6232..eb370347e 100644 --- a/config/locales/server.zh_CN.yml +++ b/config/locales/server.zh_CN.yml @@ -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} 提示:由于论坛用户标记,系统隐藏了您的帖子" diff --git a/db/migrate/20140811094300_rename_defered_columns_on_post_action.rb b/db/migrate/20140811094300_rename_defered_columns_on_post_action.rb new file mode 100644 index 000000000..ad4f7c50a --- /dev/null +++ b/db/migrate/20140811094300_rename_defered_columns_on_post_action.rb @@ -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 diff --git a/lib/flag_query.rb b/lib/flag_query.rb index 84bb40a28..ebf841bc9 100644 --- a/lib/flag_query.rb +++ b/lib/flag_query.rb @@ -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 diff --git a/spec/models/leader_requirements_spec.rb b/spec/models/leader_requirements_spec.rb index 3f24ea4e0..b2e3fc3b2 100644 --- a/spec/models/leader_requirements_spec.rb +++ b/spec/models/leader_requirements_spec.rb @@ -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|