Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save staycreativedesign/20a369fd47e18a35e6256e975f984d3a to your computer and use it in GitHub Desktop.
Save staycreativedesign/20a369fd47e18a35e6256e975f984d3a to your computer and use it in GitHub Desktop.
def find_emails_from_extra(search_term, name )
emails = []
emails << User.where(search_term: name).pluck(:email)
emails
end
how can I change the search_term: into whatever the attribute is?
so if I do
find_email_from_extra(employer_state, "FL")
#becomes
emails << User.where(employer_state: "FL").pluck(:email)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment