这是模型中的代码:
class MyModel < ActiveRecord::Base
def role
read_attributes(:role).to_sym
end
def role= value
write_attributes :role, value.to_s
end
end
但我得到了下一个错误:
undefined method read_attributes for MyModel:0x00000003014070
这是模型中的代码:
class MyModel < ActiveRecord::Base
def role
read_attributes(:role).to_sym
end
def role= value
write_attributes :role, value.to_s
end
end
但我得到了下一个错误:
undefined method read_attributes for MyModel:0x00000003014070