Class: AuthRailsGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- AuthRailsGenerator
- Defined in:
- lib/generators/auth_rails_generator.rb
Instance Method Summary collapse
Instance Method Details
#create_allowed_tokens_strategy ⇒ Object
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/generators/auth_rails_generator.rb', line 28 def create_allowed_tokens_strategy return if [:strategy].blank? || [:strategy] != 'allowed_token' invoke( 'auth_rails:migration', [], strategy: 'allowed_token', model: ([:model] || 'user').camelcase ) end |
#generate_auth_rails ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/generators/auth_rails_generator.rb', line 18 def generate_auth_rails @model = ([:model] || 'user').camelcase @is_allowed_token = [:strategy] == 'allowed_token' template( 'auth_rails.tt', 'config/initializers/auth_rails.rb' ) end |