i’m a little confused here on what’s happening.
i have two tables ITEMS and ITEM_TYPES
ITEMS (belongs_to :item_type)
here is my Item.rb model code for my query:
find(:all, :select => 'items.name, item_types.name', :include => :item_type, :conditions => ['item_types.name = ? OR item_types.name = ? OR
item_types.name = ? OR item_types.name = ?’, ‘Material’, ‘Weapon’,
:order => ‘items.name’)
currently it is selecting all fields in the ITEM table and not using the
:select that i have entered.
if i comment out the :conditions parameter the :select works properly.
i’m sure it’s something to do with the linking to the item_types table.
does anyone know how i can get the above :select working properly?