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 _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
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"
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails
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
>
>
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails