magic models on rails 2.0

3 views
Skip to first unread message

rorlaw

unread,
Nov 27, 2007, 5:23:17 PM11/27/07
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



Cheers
Lawrence

PS. I think we need magic controllers as well ;-)
Reply all
Reply to author
Forward
0 new messages