提交 00c94d7d 编写于 作者: F Francesco Rodriguez

updating define_attribute_methods documentation

上级 05234b35
......@@ -41,7 +41,7 @@ behavior out of the box:
include ActiveModel::AttributeMethods
attribute_method_prefix 'clear_'
define_attribute_methods [:name, :age]
define_attribute_methods :name, :age
attr_accessor :name, :age
......
......@@ -30,7 +30,7 @@ module ActiveModel
#
# include ActiveModel::Dirty
#
# define_attribute_methods [:name]
# define_attribute_methods :name
#
# def name
# @name
......
......@@ -3,7 +3,7 @@
class DirtyTest < ActiveModel::TestCase
class DirtyModel
include ActiveModel::Dirty
define_attribute_methods [:name, :color]
define_attribute_methods :name, :color
def initialize
@name = nil
......
......@@ -20,7 +20,7 @@ class Person
attribute_method_prefix 'reset_'
attribute_method_suffix '_highest?'
define_attribute_methods ['age']
define_attribute_methods 'age'
attr_accessor :age
......@@ -99,7 +99,7 @@ require 'active_model'
class Person
include ActiveModel::Dirty
define_attribute_methods [:first_name, :last_name]
define_attribute_methods :first_name, :last_name
def first_name
@first_name
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册