I have two models: CreditCard and BlacklistItem::CreditCard. If I search for a BlacklistItem::CreditCard first, I get the expected behaviour:
>> BlacklistItem::CreditCard.find(:all).first
=> #<BlacklistItem::CreditCard id: 5, *snip* >
>>
If I search for a CreditCard first, when I go to look for BlacklistItem::CreditCard items later I get unexpected behaviour:
>> CreditCard.find(:all).first
=> #<CreditCard id: 2, key_id: 4, *snip* >
>> BlacklistItem::CreditCard.find(:all).first
(irb):2: warning: toplevel constant CreditCard referenced by BlacklistItem::CreditCard
=> #<CreditCard id: 2, key_id: 4, *snip* >
>>
What am I doing wrong? Is it just impossible to have names with this kind of relationship between them? I'm going to rename BlacklistItem::CreditCard as a work around, but it really would be the best name for this particular object.