Sha256: 9bde4f3e7e2664a64e9b1a9761d86c8fc514b13475c5e5afdb8e55b3b93c7e8b

Contents?: true

Size: 491 Bytes

Versions: 2

Compression:

Stored size: 491 Bytes

Contents

# Permission 是权限。

class Unidom::Authorization::Permission < ActiveRecord::Base

  self.table_name = 'unidom_permissions'

  include Unidom::Common::Concerns::ModelExtension

  has_many :authorizings, class_name: 'Unidom::Authorization::Authorizing'

  validates :name, presence:    true, length: { in: 2..self.columns_hash['name'].limit }
  validates :path, allow_blank: true, length: { in: 2..self.columns_hash['path'].limit }

  scope :path_is, ->(path) { where path: path }

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
unidom-authorization-1.0 app/models/unidom/authorization/permission.rb
unidom-authorization-0.2 app/models/unidom/authorization/permission.rb