class ActiveRecord::ImmutableRelation

relation.limit!(5) # => ActiveRecord::ImmutableRelation
relation.where!(title: ‘TODO’) # => ActiveRecord::ImmutableRelation
# Methods which try to mutate a loaded relation fail.
relation.loaded? # => true
relation = Task.all
end
class Task < ActiveRecord::Base
Raised when a relation cannot be mutated because it’s already loaded.