Class: HeimdallAuth::Generators::CancanGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- HeimdallAuth::Generators::CancanGenerator
- Defined in:
- lib/generators/heimdall_auth/cancan/cancan_generator.rb
Instance Method Summary collapse
Instance Method Details
#add_ability_file ⇒ Object
6 7 8 |
# File 'lib/generators/heimdall_auth/cancan/cancan_generator.rb', line 6 def add_ability_file copy_file "ability.rb", "app/models/ability.rb" end |
#add_check_authorization_method ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/generators/heimdall_auth/cancan/cancan_generator.rb', line 10 def inject_into_file 'app/controllers/application_controller.rb', after: "class ApplicationController < ActionController::Base\n" do <<-'RUBY' check_authorization RUBY end end |