Sha256: 2276070487ebf99b3902a27e8dca7ffc768f09d7a831ba0a49f36619006335fa

Contents?: true

Size: 389 Bytes

Versions: 5

Compression:

Stored size: 389 Bytes

Contents

module Ecom
  module Model
    class UserRole < ApplicationRecord
      belongs_to :application_module
      has_and_belongs_to_many :users, join_table: 'ecom_model_users_user_roles'
      has_and_belongs_to_many :menus, join_table: 'ecom_model_menus_user_roles'

      validates :name, presence: true
      validates :name, uniqueness: { scope: :application_module_id }
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ecom_model-2.0.4 app/models/ecom/model/user_role.rb
ecom_model-2.0.3 app/models/ecom/model/user_role.rb
ecom_model-2.0.2 app/models/ecom/model/user_role.rb
ecom_model-2.0.1 app/models/ecom/model/user_role.rb
ecom_model-2.0.0 app/models/ecom/model/user_role.rb