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 Ohm Ruby
Hiya!
Dunno if anyone's reading this group, but just in case I have a quick
question. Is there a non hackish way to inheritance with Ohm::Model?
Something like this:
class A < Ohm::Model
attribute :a
end
class B < A
attribute :b
end
And then be able to do:
obj = B.new( { :a => "one", :b => "two" } )
I looked through the source of ohm and it seems that this isn't
possible without overriding self.attributes et al, but it's messing
with the internals of Ohm which feels like none of my business.
Thanks!
G.
Hung Tran
unread,
Sep 27, 2012, 7:08:34 PM9/27/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
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 ohm-...@googlegroups.com
Hi - not sure if this is still relevant to you but the case you describe below seems to work for me in 1.2 in which you can initialize the inherited attribute during create.