2012-04-06 70 views
1

当初始化对象时,是否有方法覆盖活动资源上的属性设置器?覆盖ActiveResource属性设置器

+0

正是你想做的事/改变? – 2012-04-06 09:49:58

+0

我想清理其中一个属性,例如我将使用ActiveRecord write_attribute方法进行清理。我无法找到ARes的等价物 – sailor 2012-04-06 09:59:03

回答

1

你可以尝试重写负载方法

def load(attributes, remove_root = false) 
     super(attributes, remove_root) 
     #put your code, here you have @attributes collection 
     self 
    end