New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#50 fix undefined method `args' in token.rb when calling to_param but to... #51
Conversation
…ram but token is nil
@@ -56,6 +56,12 @@ class UntaintedDocument | |||
expect(document.to_param).to_not eq document.token | |||
end | |||
|
|||
it "should return id when token does not exist when calling `to_param`" do | |||
document_class.send(:token, :override_to_param => true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the new Ruby 1.9 hash syntax.
@thetron Cheers! |
Having a look over this again, I think passing Do you think you could change it to just be |
@@ -54,7 +54,7 @@ def set_token_callbacks(options) | |||
|
|||
def override_to_param(options) | |||
self.send(:define_method, :to_param) do | |||
self.send(options.field_name) || super(*args) | |||
self.send(options.field_name) || super() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant self
detected.
@thetron I did NOT have any specific reason to pass the |
That's awesome! Thanks @warmwind! |
#50 fix undefined method `args' in token.rb when calling to_param but to...
Just released 2.1.1, which includes this fix. 🍻 |
fix undefined method `args' in token.rb when calling to_param but token is nil