Sha256: 64b9d41b46cb8568aa556107ee27e78bf5aa823f48fb9db713d9916ac212c42e
Contents?: true
Size: 560 Bytes
Versions: 2
Compression:
Stored size: 560 Bytes
Contents
class Approval < ActiveRecord::Base belongs_to :approvable, :polymorphic => true belongs_to :approver, :polymorphic => true validates :approvable_id, :approvable_type, :presence => true validates :approvable_id, :uniqueness => {:scope => :approvable_type} # Scoped wrapped in lambdas because ActiveRecord's connection hasn't been established at the # time of this classes' load. scope :pending, lambda{ where(:approved => false) } scope :approved_today, lambda{ where(:approved => true).where(arel_table[:updated_at].eq(Date.today)) } end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
acts_as_approvable-0.1.1 | lib/acts_as_approvable/approval.rb |
acts_as_approvable-0.1.0 | lib/acts_as_approvable/approval.rb |