Reputation: 25542
This is my Model (Subscription) Method:
def activation_codes(options = {})
if options[:first]
self.group.group_codes.first
else
self.group.group_codes
end
end
I am trying to call to this method in this fashion:
sub = Subscription.where(:subscription_limit => -1).first
sub.activation_codes {:first}
For some reason the else
is being evaluated.
Upvotes: 0
Views: 73
Reputation: 27901
You need to pass Hash
to method activation_codes
in order to make it work as expected, like:
sub.activation_codes({:first => 'some value'})
but you're currently passing Symbol
instead.
Upvotes: 1