Sha256: 7945c2fecc8521b024514ecec6f28e81a204cf8a5cfae4250c5baed480936eb8
Contents?: true
Size: 648 Bytes
Versions: 10
Compression:
Stored size: 648 Bytes
Contents
class Activator < ActiveRecord::Base cattr_accessor :event_names self.event_names = [ 'spree.cart.add', 'spree.checkout.coupon_code_added', 'spree.order.contents_changed', 'spree.user.signup' ] def self.register_event_name(name) self.event_names << name end scope :event_name_starts_with, lambda{|name| where('event_name like ?', "#{name}%") } scope :active, where('( starts_at IS NULL OR starts_at < ? ) AND ( expires_at IS NULL OR expires_at > ?)', Time.now, Time.now) def activate(payload) end def expired? starts_at && Time.now < starts_at || expires_at && Time.now > expires_at end end
Version data entries
10 entries across 10 versions & 1 rubygems