Sha256: e886516ee3374d682109aae14feb10ebc6874e82acff92280686a7fa49eb8413
Contents?: true
Size: 782 Bytes
Versions: 11
Compression:
Stored size: 782 Bytes
Contents
require 'rails/generators' module Pages module Generators class RolesGenerator < ::Rails::Generators::Base source_root File.expand_path("../templates", __FILE__) desc "Simple role-based authorization. A User model with roles must be available." def add_users_partial copy_file 'users/_user.html.erb', 'app/views/users/_user.html.erb' end def add_if_devise return unless File.exists?('config/initializers/devise.rb') copy_file 'devise/users_controller.rb', 'app/controllers/users_controller.rb' end def add_if_omniauth return unless File.exists?('config/initializers/omniauth.rb') copy_file 'omniauth/users_controller.rb', 'app/controllers/users_controller.rb' end end end end
Version data entries
11 entries across 11 versions & 1 rubygems