2
我有這樣一個範圍:合併範圍與CURRENT_USER
class InventoryItem < ActiveRecord::Base
belongs_to :inventory
belongs_to :game_item
# define custom scopes to get equipped inventory items for user
scope :equipped, where(:is_equipped => 1)
scope :item, lambda { |item_type|
joins(:game_item).
includes(:game_item).
where("game_items.item_type = ?", item_type).
limit(1)
}
我可以得到CURRENT_USER模型,還包括一個命令裝備項目? (?有可能包括)