views:

15

answers:

1

Does anyone know if there is a way to overload an association accessor method and not the setter?

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.

A: 

Ok can't do it.

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

Oh well live an learn.

Dan Galipo