Skip to content

Instantly share code, notes, and snippets.

@nfriend21
Last active July 22, 2021 15:59
Show Gist options
  • Save nfriend21/4b6bd24917b295ad5195531c0eab8dea to your computer and use it in GitHub Desktop.
Save nfriend21/4b6bd24917b295ad5195531c0eab8dea to your computer and use it in GitHub Desktop.
changes to Inquiry.rb
1. change has_existing_website? method on Inquiry.rb
### current method
def has_existing_website?
dynamic_fields.present? && dynamic_fields['has_website'] == 'Yes'
end
#### should be changed to:
def has_existing_website?
dynamic_fields.present? && dynamic_fields['website_address'].present?
end
### NOTE: I searched the code and saw this method being used in 2 other places. However, we are not using that functionality, but also, this method is not accurate anymore since we removed that form field. My update here actually makes the method accurate.
2. change passes_budget? method on Inquiry.rb
### current method:
def passes_budget?
if cbt_is_photographer?
if budget_okup?
true
else
false
end
else
if budget_betterup? || (budget_okup? && sold_plenty_art_before?)
true
else
false
end
end
end
### should be changed to:
def passes_budget?
if cbt_is_photographer?
if budget_okup?
true
else
false
end
else
if budget_betterup? || ( budget_okup? && (sold_plenty_art_before? || has_existing_website?) )
true
else
false
end
end
end
### Please test to make sure the above code works. I have not tested it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment