Sha256: 131ae73bfa34b8fcf06404aef1cf329f63c92d681b7304820eeb4d64dada071d

Contents?: true

Size: 608 Bytes

Versions: 18

Compression:

Stored size: 608 Bytes

Contents

module Spree
  class Promotion
    module Rules
      class 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
    end
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
spree_promo-1.1.6 app/models/spree/promotion/rules/user_logged_in.rb
spree_promo-1.1.5 app/models/spree/promotion/rules/user_logged_in.rb
spree_promo-1.2.4 app/models/spree/promotion/rules/user_logged_in.rb
spree_promo-1.3.2 app/models/spree/promotion/rules/user_logged_in.rb
spree_promo-1.2.3 app/models/spree/promotion/rules/user_logged_in.rb
spree_promo-1.3.1 app/models/spree/promotion/rules/user_logged_in.rb
spree_promo-1.3.0 app/models/spree/promotion/rules/user_logged_in.rb
spree_promo-1.3.0.rc2 app/models/spree/promotion/rules/user_logged_in.rb
dup_spree_promo-1.3.0.rc1 app/models/spree/promotion/rules/user_logged_in.rb
spree_promo-1.3.0.rc1 app/models/spree/promotion/rules/user_logged_in.rb
spree_promo-1.2.2 app/models/spree/promotion/rules/user_logged_in.rb
spree_promo-1.1.4 app/models/spree/promotion/rules/user_logged_in.rb
spree_promo-1.2.0 app/models/spree/promotion/rules/user_logged_in.rb
spree_promo-1.2.0.rc2 app/models/spree/promotion/rules/user_logged_in.rb
spree_promo-1.2.0.rc1 app/models/spree/promotion/rules/user_logged_in.rb
spree_promo-1.1.3 app/models/spree/promotion/rules/user_logged_in.rb
spree_promo-1.1.2 app/models/spree/promotion/rules/user_logged_in.rb
spree_promo-1.1.2.rc1 app/models/spree/promotion/rules/user_logged_in.rb