mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
copy edits [ci skip]
This commit is contained in:
parent
1c3bdfcda4
commit
ee917493e4
2 changed files with 4 additions and 7 deletions
|
@ -201,12 +201,9 @@ module ActiveRecord
|
|||
# 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
|
||||
# # Methods which try to mutate a loaded relation fail.
|
||||
# relation.where!(title: 'TODO') # => ActiveRecord::ImmutableRelation
|
||||
# relation.limit!(5) # => ActiveRecord::ImmutableRelation
|
||||
class ImmutableRelation < ActiveRecordError
|
||||
end
|
||||
|
||||
|
|
|
@ -205,10 +205,10 @@ TIP: Changes that are cosmetic in nature and do not add anything substantial to
|
|||
|
||||
Rails follows a simple set of coding style conventions.
|
||||
|
||||
* Use Ruby >= 1.9 syntax. Prefer `{ a: :b }` over `{ :a => :b }`.
|
||||
* Two spaces, no tabs (for indentation).
|
||||
* No trailing whitespace. Blank lines should not have any spaces.
|
||||
* Indent after private/protected.
|
||||
* Use Ruby >= 1.9 syntax for hashes. Prefer `{ a: :b }` over `{ :a => :b }`.
|
||||
* Prefer `&&`/`||` over `and`/`or`.
|
||||
* Prefer class << self over self.method for class methods.
|
||||
* Use `MyClass.my_method(my_arg)` not `my_method( my_arg )` or `my_method my_arg`.
|
||||
|
|
Loading…
Reference in a new issue