|
Is there a way to get the case statement at the bottom to work? The
problem is that if e.type == EventOne class PlayItem include DataMapper::Resource property :id, Integer, :key => true property :event_id, Integer, :nullable => false property :name, Text belongs_to, :event end class Event include DataMapper::Resource property :id, Integer, :key => true property :type, Discriminator property :name, Text has n, :play_items end class EventOne < Event end class EventTwo < Event end e = PlayItem.first.event case e.type when EventOne puts 'One' when EventTwo puts 'Two' else puts "Unknown event type #{e.type}" end --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~--- |
- [DataMapper] Using an associated model as a case statement s... Earle Clubb
