Reputation: 241
I am using the following:
@noteid = Note.find(:url => "blah").id
However, this returns the error: Unknown key(s): url
is there a way to find a record based on non-key attributes?
Upvotes: 0
Views: 1551
Reputation: 5767
Try @noteid = Note.where(:url => "blah").select('id').id
@noteid = Note.where(:url => "blah").select('id').id
Upvotes: 7