-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
While having two models, Item and Atm < Item, I'm experiencing this:
$ rails c Loading development environment (Rails 3.2.9) irb(main):001:0> Item.all.map &:_type => ["Item"] irb(main):002:0> Atm.all.map &:_type => ["Atm"] irb(main):003:0> Item.all.map &:_type => ["Item", "Atm"] irb(main):005:0> Item.ne(_type: 'Atm').map &:_type => ["Item"] irb(main):004:0> Item.where(_type: 'Item').map &:_type => ["Item", "Atm"] irb(main):005:0>
I believe that last query should not return records with _type: 'Atm'. Actually I'm having more than one Item descendant and this is bugging me when I need to get only parent records without any subclasses.