Sha256: 42202f80fc4cf71bd76ffbf65510b36da3cd6b11f257fb32b20f08b67466ea80

Contents?: true

Size: 500 Bytes

Versions: 10

Compression:

Stored size: 500 Bytes

Contents

class Promotion::Rules::UserLoggedIn < PromotionRule
  def eligible?(order, options = {})

    # this is tricky.  We couldn't use any of the devise methods since we aren't in the controller.
    # we need to rely on the controller already having done this for us.

    # The thinking is that the controller should have some sense of what state 
    # we should be in before firing events,
    # so the controller will have to set this field.

    return options && options[:user_signed_in]
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
spree_promo-0.70.7 app/models/promotion/rules/user_logged_in.rb
spree_promo-0.70.6 app/models/promotion/rules/user_logged_in.rb
spree_promo-0.70.5 app/models/promotion/rules/user_logged_in.rb
spree_promo-0.70.4 app/models/promotion/rules/user_logged_in.rb
spree_promo-0.70.3 app/models/promotion/rules/user_logged_in.rb
spree_promo-0.70.2 app/models/promotion/rules/user_logged_in.rb
spree_promo-0.70.1 app/models/promotion/rules/user_logged_in.rb
spree_promo-0.70.0 app/models/promotion/rules/user_logged_in.rb
spree_promo-0.70.0.rc2 app/models/promotion/rules/user_logged_in.rb
spree_promo-0.70.RC1 app/models/promotion/rules/user_logged_in.rb