thetron / mongoid_token

A little random, unique token generator for Mongoid documents.
MIT License
182 stars 91 forks source link

#50 fix undefined method `args' in token.rb when calling to_param but to... #51

Closed warmwind closed 10 years ago

warmwind commented 10 years ago

fix undefined method `args' in token.rb when calling to_param but token is nil

thetron commented 10 years ago

@warmwind Thanks heaps! I think we can ignore @houndci's comments, since the rest of the gem uses the pre-1.9 hash syntax.

I'll get this merged in as soon as I get a moment to take a proper look! Thanks! :coffee:

warmwind commented 10 years ago

@thetron Cheers! I got this problem in our project just now after upgrade, because in some scenario, we need to batch insert data into mongdb without token generated.

thetron commented 10 years ago

Having a look over this again, I think passing args in to_param was a mistake in the earlier version. I don't quite know why it's even there.

Do you think you could change it to just be super() (and remove the changes made to override_to_param)? Unless you can see a reason why it would need to be there.

warmwind commented 10 years ago

@thetron I did NOT have any specific reason to pass the args, but just followed the previous version. Already removed.

thetron commented 10 years ago

That's awesome! Thanks @warmwind!

thetron commented 10 years ago

Just released 2.1.1, which includes this fix. :beers: