You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Dr Nic's Magic Models
Dear Dr Nic,
Tried out the magic models on rails 2.0. The example of
person.membership.length fails with the message given below. In
magic_model.rb I changed line 79 from
rescue NotImplementedError
to:
rescue Exception
which fixed the issue.
ActiveRecord::StatementInvalid: Mysql::Error: Table
'activation_development.mem
ership' doesn't exist: SHOW CREATE TABLE membership
from C:/project.mirror42/activation/vendor/rails/activerecord/
lib/activ
_record/connection_adapters/abstract_adapter.rb:150:in `log'
from C:/project.mirror42/activation/vendor/rails/activerecord/
lib/activ
_record/connection_adapters/mysql_adapter.rb:281:in `execute'
from c:/ruby/lib/ruby/gems/1.8/gems/dr_nic_magic_models-0.9.2/
lib/conne
tion_adapters/mysql_adapter.rb:12:in `foreign_key_constraints'
from c:/ruby/lib/ruby/gems/1.8/gems/dr_nic_magic_models-0.9.2/
lib/dr_ni
_magic_models/magic_model.rb:80:in `find_has_some'
from C:/project.mirror42/activation/vendor/rails/activerecord/
lib/activ
_record/attribute_methods.rb:205:in `inject'
from c:/ruby/lib/ruby/gems/1.8/gems/dr_nic_magic_models-0.9.2/
lib/dr_ni
_magic_models/magic_model.rb:78:in `each'
from c:/ruby/lib/ruby/gems/1.8/gems/dr_nic_magic_models-0.9.2/
lib/dr_ni
_magic_models/magic_model.rb:78:in `inject'
from c:/ruby/lib/ruby/gems/1.8/gems/dr_nic_magic_models-0.9.2/
lib/dr_ni
_magic_models/magic_model.rb:78:in `find_has_some'
from c:/ruby/lib/ruby/gems/1.8/gems/dr_nic_magic_models-0.9.2/
lib/dr_ni
_magic_models/magic_model.rb:31:in `method_missing'
from (irb):3