Forum: Ruby on Rails reset_authentication_token! method not being called but reset_authentication_token_! can be called

Dfc2bcf6c3aae119bb8a148842660405?d=identicon&s=25 unknown (Guest)
on 2013-12-19 17:43
(Received via mailing list)
I am having problems calling a method reset_authentication_token! . if i
just leave the method as it is with the ! behind it the method is simply
ignored when the program is run (none of the logger methods inside the
method is called.) But if i add any other character into it the method
gets
called

Below is the module of the methods.
This module is included in user.rb

The module auth_token.rb
http://pastie.org/8563575

The user.rb

http://pastie.org/8563585

This is the session_controller.rb file

http://pastie.org/8563578

The reset_authentication_token! is called from the main create method
which
calls the @user.ensure_authentication_token!
4c6bde00168d595053c09aac7e487f8e?d=identicon&s=25 Colin Law (Guest)
on 2013-12-19 17:52
(Received via mailing list)
On 19 December 2013 16:41,  <shwntn1@gmail.com> wrote:
> http://pastie.org/8563575
> calls the @user.ensure_authentication_token!
Is it possible that there is another method
reset_authentication_token! in the system somewhere?  If you comment
out your method and run the code do you get a runtime no method error?
 If not then there is another method of this name.

For the future, have a look at the Rails Guide on debugging to see how
to debug your code and see what is happening by stepping into that
method.

Colin
Dfc2bcf6c3aae119bb8a148842660405?d=identicon&s=25 unknown (Guest)
on 2013-12-19 17:58
(Received via mailing list)
Colin yes if i uncomment it out does still run but how do i find where
the
code replication takes place? I think its one of the additional gems but
i
don't know how to search for where this method exists
4c6bde00168d595053c09aac7e487f8e?d=identicon&s=25 Colin Law (Guest)
on 2013-12-19 18:12
(Received via mailing list)
On 19 December 2013 16:56,  <shwntn1@gmail.com> wrote:
> Colin yes if i uncomment it out does still run but how do i find where the
> code replication takes place? I think its one of the additional gems but i
> don't know how to search for where this method exists

Please don't top post, it makes it difficult to follow the thread.
Thanks.

As I said if you have a look at the rails guide on debugging it will
show you how you can step into the code.  Also you could do a global
text search in your application and gems directories.

Are you using Devise?  If so I would start there.  Googling for the
method name gave me that clue.

Colin
Dfc2bcf6c3aae119bb8a148842660405?d=identicon&s=25 tyl (Guest)
on 2013-12-19 18:32
(Received via mailing list)
My bad, I havent used google groups for a long time forgot about it. I
found this method object.method(:method_name).source_location .
Apparently comes from active model
/.rvm/gems/ruby-2.0.0-p353/gems/activemodel-4.0.2/lib/active_model/attribute_methods.rb",
382]. Thanks for the help
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.