Sha256: 8dda829ee50a23712a96df5ba33757ce67bbefacfe6ace75360af048cbb44d3d
Contents?: true
Size: 734 Bytes
Versions: 5
Compression:
Stored size: 734 Bytes
Contents
module ESA module Contexts class AccountableContext < ESA::Context attr_accessible :accountable, :accountable_id, :accountable_type attr_readonly :accountable, :accountable_id, :accountable_type belongs_to :accountable, :polymorphic => true validates_presence_of :accountable protected def create_name "#{self.accountable_type} #{self.accountable_id}" unless self.accountable_type.nil? end def initialize_filters @filters = [] if self.accountable_id.present? and self.accountable_type.present? @filters << lambda { |relation| relation.with_accountable(self.accountable_id, self.accountable_type) } end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems