I'm trying to call an instance method (defined in model) from the instance variable in controller but could not get that work and server logs saying
undefined method `active_users' for #< Admin
controller
@admin = Admin.first
@admin.active_users
Admin Model
def self.active_users
byebug
end
I know that we can call it through the class directly like Admin.active_users .
Why is it not accessible by instance of the class?