Hi all,
I really like Datamapper's STI feature, but now suddenly stumble on a
strange error that I cannot really explain.
Code:
event_observers.all(:event_id.gte => start_id).each do |e|
events_list.push(e.get_info)
end
These event_observers can have three types, EventObserver,
EventObserverActor and EventObserverVictim. I get the following error:
~ (0.000510) SELECT `id`, `type`, `event_id`, `character_id` FROM
`cantr3_event_observers` WHERE `type` IN ('Cantr3::EventObserver',
'Cantr3::EventObserverActor', 'Cantr3::EventObserverVictim') AND `event_id`
>= 0 AND `character_id` = 1 ORDER BY `id`
~ (0.001173) SELECT `id`, `type`, `created_at` FROM `cantr3_events` WHERE
`type` IN ('Cantr3::Event', 'Cantr3::ItemEvent', 'Cantr3::DropEvent',
'Cantr3::PickUpEvent', 'Cantr3::SayEvent', 'Cantr3::WhisperEvent',
'Cantr3::SpawnEvent') AND `id` IN (1, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16)
ORDER BY `id`
E, [2009-09-20T21:16:29.405333 #2740] ERROR -- : Uncaught error: +source+
should be Cantr3::EventObserverActor, but was Cantr3::EventObserver Trace:
E, [2009-09-20T21:16:29.406002 #2740] ERROR -- :
/opt/local/lib/ruby/gems/1.8/gems/dm-core-0.10.0/lib/dm-core/associations/many_to_one.rb:217:in
`eager_load_targets'
E, [2009-09-20T21:16:29.406107 #2740] ERROR -- :
/opt/local/lib/ruby/gems/1.8/gems/dm-core-0.10.0/lib/dm-core/associations/relationship.rb:293:in
`eager_load'
E, [2009-09-20T21:16:29.406178 #2740] ERROR -- :
/opt/local/lib/ruby/gems/1.8/gems/dm-core-0.10.0/lib/dm-core/associations/relationship.rb:291:in
`each'
E, [2009-09-20T21:16:29.406258 #2740] ERROR -- :
/opt/local/lib/ruby/gems/1.8/gems/dm-core-0.10.0/lib/dm-core/associations/relationship.rb:291:in
`eager_load'
E, [2009-09-20T21:16:29.406334 #2740] ERROR -- :
/opt/local/lib/ruby/gems/1.8/gems/dm-core-0.10.0/lib/dm-core/associations/many_to_one.rb:196:in
`lazy_load'
E, [2009-09-20T21:16:29.406391 #2740] ERROR -- :
/opt/local/lib/ruby/gems/1.8/gems/dm-core-0.10.0/lib/dm-core/associations/many_to_one.rb:96:in
`get'
E, [2009-09-20T21:16:29.406465 #2740] ERROR -- :
/opt/local/lib/ruby/gems/1.8/gems/dm-core-0.10.0/lib/dm-core/associations/many_to_one.rb:160:in
`event'
E, [2009-09-20T21:16:29.406544 #2740] ERROR -- : ./event_observer.rb:24:in
`get_info'
E, [2009-09-20T21:16:29.406618 #2740] ERROR -- : ./event.rb:98:in
`get_events'
This error only started occurring today, after upgrading to 0.10. It also
happens with a completely different set of inherited classes (also since the
upgrade).
Anyone any idea what this might be?
Jos
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"DataMapper" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/datamapper?hl=en
-~----------~----~----~----~------~----~------~--~---