Open jamesarosen opened 15 years ago
I have a owner model:
class Person < ActiveRecord::Base has_many_polymorphs :things, :from => [ :books, :cds, :dvds ], :through => :person_things end
a relationship model:
class PersonThing < ActiveRecord::Base belongs_to :person belongs_to :thing, :polymorphic => true end
and several owned models:
class Book < ActiveRecord::Base end ...
If I create a relationship:
person = Person.create!(:name => 'Barney') book = Book.create!('Dinosaurs for Dummies') person.things << book
then include? fails even when select doesn't:
include?
select
person.things.include? book # => false person.things.select { |t| t == book }.any? # => true
I'm guessing include? is redefined on this enumeration, but it's not redefined correctly.
best bet is to make a failing test and fix it yourself; this project is in patch-accepting-mode only :-/
I have a owner model:
a relationship model:
and several owned models:
If I create a relationship:
then
include?
fails even whenselect
doesn't:I'm guessing
include?
is redefined on this enumeration, but it's not redefined correctly.