lib/generators/petergate/install_generator.rb in petergate-1.6.3 vs lib/generators/petergate/install_generator.rb in petergate-1.6.4
- old
+ new
@@ -12,16 +12,16 @@
sleep 1
Time.now.utc.strftime("%Y%m%d%H%M%S")
end
def insert_into_user_model
- inject_into_file "app/models/user.rb", after: /^class\sUser < ActiveRecord::Base/ do
+ inject_into_file "app/models/user.rb", after: /^class\sUser < ActiveRecord::Base|^class User < ApplicationRecord/ do
<<-'RUBY'
############################################################################################
## PeterGate Roles ##
## The :user role is added by default and shouldn't be included in this list. ##
- ## The :root_admin can access any page regardless of access settings. Use with caution! ##
+ ## The :root_admin can access any page regardless of access settings. Use with caution! ##
## The multiple option can be set to true if you need users to have multiple roles. ##
petergate(roles: [:admin, :editor], multiple: false) ##
############################################################################################
RUBY