diff options
author | Francesco Rodriguez <lrodriguezsanc@gmail.com> | 2012-10-26 13:40:24 -0500 |
---|---|---|
committer | Francesco Rodriguez <lrodriguezsanc@gmail.com> | 2012-10-26 13:40:53 -0500 |
commit | 7a36dc736f6094322dc8bbcf3c98c1cf185d78af (patch) | |
tree | 64cbd4e791b19869f1cb362c3a5635c3101e44bb /activerecord/lib/active_record | |
parent | b1e5c1660b40688993f3ed151143a26da55082db (diff) | |
download | rails-7a36dc736f6094322dc8bbcf3c98c1cf185d78af.tar.gz rails-7a36dc736f6094322dc8bbcf3c98c1cf185d78af.tar.bz2 rails-7a36dc736f6094322dc8bbcf3c98c1cf185d78af.zip |
update AR::ImmutableRelation documentation [ci skip]
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/errors.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/errors.rb b/activerecord/lib/active_record/errors.rb index 0637dd58b6..f039c23675 100644 --- a/activerecord/lib/active_record/errors.rb +++ b/activerecord/lib/active_record/errors.rb @@ -193,6 +193,20 @@ module ActiveRecord end + # Raised when a relation cannot be mutated because it's already loaded. + # + # class Task < ActiveRecord::Base + # end + # + # relation = Task.all + # relation.loaded? # => true + # + # # where! will try to mutate the relation, but this will fails because it's loaded + # relation.where!(title: 'TODO') + # # => ActiveRecord::ImmutableRelation + # + # relation.limit!(5) + # # => ActiveRecord::ImmutableRelation class ImmutableRelation < ActiveRecordError end |