I’ve been toying over these two problems, but I’m hoping that someone
here might be able to provide a better idea.
Every user has their own id (current_user.id) and can add people to a
list with firstname and lastname fields. I understand that
validates_uniqueness_of with :scope should be able to compare at least
one of the fields, but can this validation be done against the combined
first and last name together?
Does anyone have a better reference for structuring conditions within
finds? Specifically, I’m trying to figure out how to adjust this query
to find matches between either lastname AND email or lastname and phone
User.find(:first, :conditions => [“lastname = ? AND email = ?”,
If anyone could lend a hand, I’d really appreciate it. Sorry if these
questions are a bit basic, as well.