提交 9dbccf02 编写于 作者: M Matthew Draper

Merge pull request #21205 from akihiro17/fix-doc

[ci skip] Fix the indentation
......@@ -385,27 +385,27 @@ def []=(attr_name, value)
#
# For example:
#
# class PostsController < ActionController::Base
# after_action :print_accessed_fields, only: :index
# class PostsController < ActionController::Base
# after_action :print_accessed_fields, only: :index
#
# def index
# @posts = Post.all
# end
# def index
# @posts = Post.all
# end
#
# private
# private
#
# def print_accessed_fields
# p @posts.first.accessed_fields
# def print_accessed_fields
# p @posts.first.accessed_fields
# end
# end
# end
#
# Which allows you to quickly change your code to:
#
# class PostsController < ActionController::Base
# def index
# @posts = Post.select(:id, :title, :author_id, :updated_at)
# class PostsController < ActionController::Base
# def index
# @posts = Post.select(:id, :title, :author_id, :updated_at)
# end
# end
# end
def accessed_fields
@attributes.accessed
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册