Sha256: ded78e69ff3506fe2746577ddc7d47a7fdce838b8b0149cf3fc008633ae94573

Contents?: true

Size: 416 Bytes

Versions: 26

Compression:

Stored size: 416 Bytes

Contents

class Promotion::Rules::User < PromotionRule
  belongs_to :user
  has_and_belongs_to_many :users, :class_name => '::User', :join_table => 'promotion_rules_users', :foreign_key => 'promotion_rule_id'

  def eligible?(order)
    users.none? or users.include?(order.user)
  end

  def user_ids_string
    user_ids.join(',')
  end

  def user_ids_string=(s)
    self.user_ids = s.to_s.split(',').map(&:strip)
  end

end

Version data entries

26 entries across 26 versions & 7 rubygems

Version Path
apispree_promo-0.0.0 app/models/promotion/rules/user.rb
My-Commerce_promo-1.1.0 app/models/promotion/rules/user.rb
My-Commerce_promo-1.0.0 app/models/promotion/rules/user.rb
MyCommerceapi-1.0.0 promo/app/models/promotion/rules/user.rb
MyCommerce-0.0.3 promo/app/models/promotion/rules/user.rb
rfcommerce_promo-0.0.3 app/models/promotion/rules/user.rb
spree_promo-0.60.6 app/models/promotion/rules/user.rb
spree_promo-0.60.5 app/models/promotion/rules/user.rb
spree_promo-0.40.4 app/models/promotion/rules/user.rb
spree_promo-0.50.4 app/models/promotion/rules/user.rb
spree_promo-0.60.4 app/models/promotion/rules/user.rb
spree_promo-0.50.3 app/models/promotion/rules/user.rb
spree_promo-0.60.3 app/models/promotion/rules/user.rb
spree_promo-0.60.2 app/models/promotion/rules/user.rb
spree_bushido_promo-0.80.28 app/models/promotion/rules/user.rb
spree_bushido_promo-0.80.27 app/models/promotion/rules/user.rb
spree_promo-0.60.1 app/models/promotion/rules/user.rb
spree_promo-0.60.0 app/models/promotion/rules/user.rb
spree_promo-0.60.0.RC1 app/models/promotion/rules/user.rb
spree_promo-0.50.2 app/models/promotion/rules/user.rb