Sha256: 25c1427652a6d96f2bd6d2dff232a0692be7d0fa64a20168fc35e1d355d2f025
Contents?: true
Size: 582 Bytes
Versions: 3
Compression:
Stored size: 582 Bytes
Contents
module KirguduBase module Concerns::Models::AdministratedBy extend ActiveSupport::Concern included do before_query :query_add_administrated_by belongs_to :administrator, class_name: ::KirguduBase::Security::User, foreign_key: :administrated_by scope :by_administrator, lambda { |value| where(administrated_by: value) if value } end def administrator_name self.administrator.full_name if self.administrator end module ClassMethods def query_add_administrated_by(query, filters) query.by_updated_by(filters[:updated_by]) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems