开发者

Overloading association methods

Does anyone know if there is a way to overload an association accessor method and not the s开发者_开发问答etter?

For example

class Bar
  has_many :users

  def users
    'foo'
  end

end

a = Bar.new
a.users # => 'foo'
a.users << bob => [bob]

Hope that makes sense.


Ok can't do it.

I'm overloading the method that accesses the association proxy object.

Oh well live an learn.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜