diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-10-28 14:45:46 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-10-28 14:45:46 -0700 |
commit | 852e376a5199ff700ec95d1ac916f4509f48e85e (patch) | |
tree | 253d70f1bfc68985181c1f683444c5918a6550f1 /activerecord/lib | |
parent | c6f47c198034ed2031723a16069005b321846452 (diff) | |
parent | 300d080ada31ac297264e6abba6ca16cd2db5925 (diff) | |
download | rails-852e376a5199ff700ec95d1ac916f4509f48e85e.tar.gz rails-852e376a5199ff700ec95d1ac916f4509f48e85e.tar.bz2 rails-852e376a5199ff700ec95d1ac916f4509f48e85e.zip |
Merge pull request #7750 from xuanxu/none_modificating_relation_in_place
Added ActiveRecord::Relation#none! method
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index 14bcb337e9..4fdc296c7e 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -496,6 +496,11 @@ module ActiveRecord extending(NullRelation) end + # Like #none, but modifies relation in place. + def none! + extending!(NullRelation) + end + # Sets readonly attributes for the returned relation. If value is # true (default), attempting to update a record will result in an error. # |