ArgumentError: wrong number of arguments (1 for 0)
from /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3.7116/lib/
active_record/callbacks.rb:332:in `notify'
from /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3.7116/lib/
active_record/callbacks.rb:332:in `callback'
from /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3.7116/lib/
active_record/callbacks.rb:299:in `valid?'
from /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3.7116/lib/
active_record/validations.rb:847:in `save_without_transactions'
...
I believe that the notify column is being invoked rather than the
expected notify method on line 332 of callbacks.rb
Is there a way around this?
I couldn't find a solution that had been posted for this particular
column name, though others have reported similar issues and in most
cases the answer was to rename the column. Not an option in this case.
I agree with those sentiments about coherency, which is why I call it
a hack, there are undoubtedly other keywords that should be treated in
this way, I've 'solved' it for the notify method, but what about
others where the method signature is identical - i.e. the method takes
no arguments? I don't think this hack works for those methods.
There does seem to be a way to prevent attribute read, query and write
methods being set but it's a global switch, so affects all
ActiveRecord objects, which is not all that useful 'cos having the
attribute methods is very useful on non-legacy tables!
I dug around the AR:Base code but couldn't quite work out where the
attribute methods were being introduced or if the method where it was
done could be overriden. Maybe I'll see if a plugin would be able to
do this - act_as_dumb_orm_model maybe?