BEFORE
gem 'the_role', '~> 2.X'
or
gem 'the_role', '~> 2.X'
gem 'the_role_bootstrap3_ui'
AFTER
gem 'the_role', '~> 3.0'
or
gem 'the_role_api', '~> 3.0'
gem 'the_role_management_panel', '~> 3.0'
config/routes.rb
before
namespace :admin do
TheRole::Routes.mixin(self)
end
after
TheRoleManagementPanel::Routes.mixin(self)
before
class User < ActiveRecord::Base
include TheRole::User
end
after
class User < ActiveRecord::Base
include TheRole::Api::User
end
class Role < ActiveRecord::Base
include TheRole::Role
end
after
class Role < ActiveRecord::Base
include TheRole::Api::Role
end
config/initializers/the_role.rb
before
TheRole.configure do |config|
config.destroy_strategy = nil
config.default_user_role = :blogger
config.layout = :application
config.first_user_should_be_admin = true
end
after
TheRole.configure do |config|
# [ Devise => :authenticate_user! | Sorcery => :require_login ]
config.login_required_method = :authenticate_user!
# layout for Management panel
config.layout = :the_role_management_panel
config.default_user_role = :blogger
config.first_user_should_be_admin = true
# config.access_denied_method = :access_denied
# config.destroy_strategy = :nil
end
how to use native :json column
bundle
rails s