diff options
author | Andrés Mejía <andmej@gmail.com> | 2011-08-27 23:10:25 -0500 |
---|---|---|
committer | Andrés Mejía <andmej@gmail.com> | 2011-08-30 16:33:37 -0500 |
commit | 84dad446c6a23a15f67b9d558e8039891a008bff (patch) | |
tree | 6c0560bca9644384c59f21a3807561d6a4ed102b /railties/test/generators_test.rb | |
parent | 2350fecd2251584d770afc4bd1764b3fe526ff70 (diff) | |
download | rails-84dad446c6a23a15f67b9d558e8039891a008bff.tar.gz rails-84dad446c6a23a15f67b9d558e8039891a008bff.tar.bz2 rails-84dad446c6a23a15f67b9d558e8039891a008bff.zip |
Adding first_or_create, first_or_create!, first_or_new and first_or_build to Active Record.
This let's you write things like:
User.where(:first_name => "Scarlett").first_or_create!(:last_name => "Johansson", :hot => true)
Related to #2420.
Diffstat (limited to 'railties/test/generators_test.rb')
0 files changed, 0 insertions, 0 deletions