提交 b6cf1113 编写于 作者: A Alexey Muranov

Align indentation in comments

上级 99c741e3
...@@ -115,10 +115,10 @@ class TooManyRecords < ActiveRecordError ...@@ -115,10 +115,10 @@ class TooManyRecords < ActiveRecordError
# hashes if they fail to pass your criteria. For example, the previous # hashes if they fail to pass your criteria. For example, the previous
# example could be rewritten as: # example could be rewritten as:
# #
# class Member < ActiveRecord::Base # class Member < ActiveRecord::Base
# has_many :posts # has_many :posts
# accepts_nested_attributes_for :posts, reject_if: proc { |attributes| attributes['title'].blank? } # accepts_nested_attributes_for :posts, reject_if: proc { |attributes| attributes['title'].blank? }
# end # end
# #
# params = { member: { # params = { member: {
# name: 'joe', posts_attributes: [ # name: 'joe', posts_attributes: [
...@@ -135,19 +135,19 @@ class TooManyRecords < ActiveRecordError ...@@ -135,19 +135,19 @@ class TooManyRecords < ActiveRecordError
# #
# Alternatively, :reject_if also accepts a symbol for using methods: # Alternatively, :reject_if also accepts a symbol for using methods:
# #
# class Member < ActiveRecord::Base # class Member < ActiveRecord::Base
# has_many :posts # has_many :posts
# accepts_nested_attributes_for :posts, reject_if: :new_record? # accepts_nested_attributes_for :posts, reject_if: :new_record?
# end # end
# #
# class Member < ActiveRecord::Base # class Member < ActiveRecord::Base
# has_many :posts # has_many :posts
# accepts_nested_attributes_for :posts, reject_if: :reject_posts # accepts_nested_attributes_for :posts, reject_if: :reject_posts
# #
# def reject_posts(attributed) # def reject_posts(attributed)
# attributed['title'].blank? # attributed['title'].blank?
# end # end
# end # end
# #
# If the hash contains an <tt>id</tt> key that matches an already # If the hash contains an <tt>id</tt> key that matches an already
# associated record, the matching record will be modified: # associated record, the matching record will be modified:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册