Hi everyone,
I need a way to make association collection methods (particularly the append <<) private. Here's an example:
class Foo < ActiveRecord::Base
has_many :bars
def add_bar (bar)
# does something extra first
# but still also use the <<, ultimately
bars.send(:<<, bar)
end
end
Basically, i do not want any part of the application to be using << by itself, i need it to go through the "add_bar" method. Any suggestions?
Thank you very much!