Further to the below, it seems it doesn't display the actual recursive tail
that's the problem.
> Well, since at least one person is interested, I'll carry on. I put in your
> egregious hack :-) and now I get a stack overflow. What's puzzling is that
> while this stack trace is deepish, it seems perfectly normal to me.
> /Users/gisborne/.gem/ruby/1.8/gems/activerecord-2.3.5/lib/active_record/attribute_methods.rb:64:in
> `generated_methods?'
> /Users/gisborne/.gem/ruby/1.8/gems/activerecord-2.3.5/lib/active_record/attribute_methods.rb:241:in
> `method_missing'
> /Users/gisborne/.gem/ruby/1.8/gems/activerecord-2.3.5/lib/active_record/attribute_methods.rb:249:in
> `method_missing'
I'm now getting a loop in method_missing, around the following lines:
def method_missing(method_id, *args, &block)
method_name = method_id.to_s
if self.class.private_method_defined?(method_name)
raise NoMethodError.new("Attempt to call private method", method_name,
args)
end
# If we haven't generated any methods yet, generate them, then
# see if we've created the method we're looking for.
if !self.class.generated_methods?
self.class.define_attribute_methods
if self.class.generated_methods.include?(method_name)
return self.send(method_id, *args, &block)
end
end
if self.class.primary_key.to_s == method_name
id
We're getting to id, and going straight back into method_missing again.
What on earth could I have done to cause this craptastic cascade of failures?
Regards,
Guyren G Howe
Relevant Logic LLC
guyren-at-relevantlogic.com ~ http://relevantlogic.com ~ +1 512 784 3178
Ruby/Rails, REALbasic, PHP programming
PostgreSQL, MySQL database design and consulting
Technical writing and training
Read my book, Real OOP with REALbasic:
<http://relevantlogic.com/oop-book/about-the-oop-book.php>
--
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby