Skip to content

Commit

Permalink
Use Spree.user_class in Spree::Promotion::Rules::User
Browse files Browse the repository at this point in the history
  • Loading branch information
radar committed Jun 20, 2012
1 parent 8f977dc commit 0427652
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions promo/app/models/spree/promotion/rules/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ module Rules
class User < PromotionRule
attr_accessible :user_ids_string

belongs_to :user, :class_name => Spree::User
has_and_belongs_to_many :users, :class_name => ::Spree::User, :join_table => :spree_promotion_rules_users, :foreign_key => :promotion_rule_id
belongs_to :user, :class_name => Spree.user_class.to_s
has_and_belongs_to_many :users, :class_name => Spree.user_class.to_s, :join_table => 'spree_promotion_rules_users', :foreign_key => 'promotion_rule_id'

def eligible?(order, options = {})
users.none? or users.include?(order.user)
Expand Down

0 comments on commit 0427652

Please sign in to comment.