undefined method assert_valid_keys

undefined method `assert_valid_keys'

occurred for me when I made a method called 'sum' for my /app/duckage.rb
just-for-fun model called Duckage. In general, it seems like you
should avoid using built-in ruby method names. (For example, "sum" is
built into some Ruby classes like Array. Also avoid using built-in
method names for the names of your table columns. The reason is cuz
Rails relies on method missing, which looks up all the methods in the
inheiritance hierarchy all the way down to Ruby's Object and Kernel
classes and if it doesn't find anything it creates an attr_accessor
method on the fly. I really should test this hypothesis before posting
it, but I'm pretty sure Rails works like this.

David :slight_smile:

Elliott Pogue wrote:

Thanks, worked like a magic.