1 2 |
foo = Bar.find(:first, :conditions => {:name => "Fred"}) || Bar.new(:name => "Fred") |
Model.find_or_create_by_COLUMN, where COLUMN is the name of the column.
1 2 |
foo = Bar.find(:first, :conditions => {:name => "Fred"}) || Bar.new(:name => "Fred") |
Model.find_or_create_by_COLUMN, where COLUMN is the name of the column.