Class: Pageflow::Generators::CancanGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/pageflow/cancan/cancan_generator.rb

Instance Method Summary collapse

Instance Method Details

#configure_active_adminObject


8
9
10
11
12
# File 'lib/generators/pageflow/cancan/cancan_generator.rb', line 8

def configure_active_admin
  inject_into_file 'config/initializers/active_admin.rb', after: "  config.authentication_method = :authenticate_user!\n" do
    "  config.authorization_adapter = ActiveAdmin::CanCanAdapter\n"
  end
end

#create_abilityObject


14
15
16
# File 'lib/generators/pageflow/cancan/cancan_generator.rb', line 14

def create_ability
  template 'ability.rb', 'app/models/ability.rb'
end