I'm trying to override the behavior of find_with_associations for an acts_as plugin. Not having much luck as it's a private method, so I can't alias it, and my method of the same name is ignored. Is this even possible? joshua
on 2005-12-04 03:43
on 2005-12-04 04:28
In the ruby example below, it looks like you can override a private function. Can you post code? -Peter class A private def foo "foo" end end class A private def foo "foofoo" end public def bar foo end end a = A.new puts a.bar # outputs "foofoo"
on 2005-12-04 05:20
In the process of grabbing my code to post, I solved it!!! I had to include the methods straight into ActiveRecord::Base not into ActiveRecord::Associations eg ActiveRecord::Base.send :include, Democracy::Acts::Multilingual::Associations I was worried that it just wasn't possible, because doing something as simple as this doesn't work module ActiveRecord module Associations private def association_join(*args) breakpoint super end end end