I have made a method called closed? in my HelpDesk model.
I am getting the following error.
undefined method 'closed?' for #<ActiveRecord::Relation:0x19311c0>
My 2 models are
class HelpDesk < ActiveRecord::Base belongs_to :user def closed? return false if closed == 0 end end
class User < ActiveRecord::Base has_many :help_desks end
Then my controller is
def helpdeskcalls user = User.find(current_user.id) @help_desks = user.help_desks.closed? end
I’m not sure what this error means, Any help would be appreciated.