when I create a new user to avoid duplicates, I use the find_or_initialize method:
user = find_or_initialize_by_email(the_email)
If this user is created with the corresponding company, how can I avoid duplicates in companies?
Can I do something like:
find_or_initialize_by_email_and_by_company_name(the_email, the_company_name)
Thanks!
source share