LaunchPadLab / token-master

Minimal and Simple user management for Ruby and Rails applications.
MIT License
17 stars 1 forks source link

Token master doesn't play nice with Active Admin #44

Closed wade00 closed 7 years ago

wade00 commented 7 years ago

I'm not 100% certain what the problem is yet, but I just want to get this down as an issue before digging in.

Token master is working as expected with my User model in my normal client <-> API communication, but when navigating the Active Admin interface I get an error undefined method 'token_master'.

The stack trace shows the error happening when the app is building the admin routes with ActiveAdmin.routes(self).

Relevant user model code:

class User < ApplicationRecord
  include TokenMaster::Core
  token_master :reset_password
  has_secure_password

I will look into this, but if anyone has seen this issue please post here!

davemcorwin commented 7 years ago

There has been some refactoring for the latest versions. In your model you want to include TokenMaster::Model. You can also just add this in the base ApplicationRecord class so you don't have to add it anywhere else.

wade00 commented 7 years ago

Oh awesome. Thank you token master!

wade00 commented 7 years ago

Just added this - looks like it's working! Going to close the issue. It looks like the README is up to date so I don't think there's any action to take.