Topic: undefined method
Hi
Why im getting this one undefined method 'with_item' for nil:NilClass??
i have a namespace model
module MyV
class ItemDisplay < Connector::MyConnector
set_primary_keys :user_id, :item_id
belongs_to: user, foreign_key =>user_id
named_scope :with_item, :conditions =>["item_counter > 0]
end
endand in my controller
// will not list all the code but will just put where the error start
module MyV
class ItemsController < ApplicationController
def listitems
@results.concat current_user. item_display.with_item
end
end
endand here is the connection part between the user and item display users the model part
has_one : item_display , :class_name => 'MyV::ItemDisplay, :foreign_key:user_id