Browse files

update AR::ImmutableRelation documentation [ci skip]

  • Loading branch information...
1 parent b1e5c16 commit 7a36dc736f6094322dc8bbcf3c98c1cf185d78af Francesco Rodriguez committed Oct 26, 2012
Showing with 14 additions and 0 deletions.
  1. +14 −0 activerecord/lib/active_record/errors.rb
View
14 activerecord/lib/active_record/errors.rb
@@ -193,6 +193,20 @@ def initialize(model)
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

0 comments on commit 7a36dc7

Please sign in to comment.