Sha256: f1f6c1a8e45a19135121173de17c81dffbc45f6eefb1b5fb3888c6dbfc8b7379

Contents?: true

Size: 1.09 KB

Versions: 3

Compression:

Stored size: 1.09 KB

Contents

module Authz
  # Each instance represents a mapping from business processes to a controller action.
  # For example, the "publish reports" business process may map to: reports#publish and reports#show
  class BusinessProcessHasControllerAction < self::ApplicationRecord
    # Associations
    # ==========================================================================
    belongs_to :controller_action, class_name: 'Authz::ControllerAction',
                                   foreign_key: 'authz_controller_action_id',
                                   inverse_of: :business_process_has_controller_actions
    belongs_to :business_process, class_name: 'Authz::BusinessProcess',
                                  foreign_key: 'authz_business_process_id',
                                  inverse_of: :business_process_has_controller_actions,
                                  touch: true

    # Validations
    # ===========================================================================
    validates :authz_controller_action_id,
              uniqueness: { scope: [:authz_business_process_id] }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
authz-0.0.5 app/models/authz/business_process_has_controller_action.rb
authz-0.0.4 app/models/authz/business_process_has_controller_action.rb
authz-0.0.3 app/models/authz/business_process_has_controller_action.rb