Last active
July 22, 2021 15:59
-
-
Save nfriend21/4b6bd24917b295ad5195531c0eab8dea to your computer and use it in GitHub Desktop.
changes to Inquiry.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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