Skip to content

Commit

Permalink
change the name according to reviewer's suggestion
Browse files Browse the repository at this point in the history
Since this method takes an action,
I suggest to name it with the verb name in imperative form
  • Loading branch information
vasconsaurus committed Oct 30, 2024
1 parent 9944a3f commit 2884671
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/models/project_media.rb
Original file line number Diff line number Diff line change
Expand Up @@ -432,22 +432,22 @@ def apply_rules_and_actions_on_update

def self.handle_fact_check_for_existing_claim(existing_pm,new_pm)
if existing_pm.fact_check.blank?
existing_pm.appended_fact_check_from(new_pm)
existing_pm.append_fact_check_from(new_pm)
elsif existing_pm.fact_check.present?
if existing_pm.fact_check.language != new_pm.set_fact_check['language']
new_pm.replaced_with_blank_media
new_pm.replace_with_blank_media
end
end
end

def appended_fact_check_from(new_pm)
def append_fact_check_from(new_pm)
self.set_claim_description = new_pm.set_claim_description
self.set_fact_check = new_pm.set_fact_check
self.create_claim_description_and_fact_check
self
end

def replaced_with_blank_media
def replace_with_blank_media
m = Blank.create!
self.set_original_claim = nil
self.media_id = m.id
Expand Down

0 comments on commit 2884671

Please sign in to comment.