module RighterForResource::ClassMethodsForActiveRecord

Public Instance Methods

auto_manage_righter_right(right_name_prefix, options = {}) click to toggle source
# File lib/injections/righter_for_resource.rb, line 101
def auto_manage_righter_right(right_name_prefix, options = {})
  unless right_name_prefix.present?
    fail RighterArgumentError.new('No prefix for autocreated right name provided...')
  end

  after_create { create_righter_right(right_name_prefix, options) } # called on instance level
  before_destroy { destroy_righter_right(right_name_prefix, options) } # called on instance level
end