Sha256: 22e443c60017db769b4128ba7c60dccad753329e0a54ddf5ccbdc09309a4745c

Contents?: true

Size: 485 Bytes

Versions: 21

Compression:

Stored size: 485 Bytes

Contents

module Workarea
  module Storefront
    module UserActivity
      def user_activity
        return Recommendation::UserActivity.new if current_user_activity_id.blank?

        @user_activity ||= Recommendation::UserActivity.find_or_initialize_by(
          id: current_user_activity_id
        )
      end

      def current_user_activity_id
        current_user.try(:id).presence ||
          session.id.try(:cookie_value).presence ||
          session.id
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
workarea-storefront-3.4.45 app/controllers/workarea/storefront/user_activity.rb
workarea-storefront-3.4.44 app/controllers/workarea/storefront/user_activity.rb
workarea-storefront-3.4.43 app/controllers/workarea/storefront/user_activity.rb
workarea-storefront-3.4.42 app/controllers/workarea/storefront/user_activity.rb
workarea-storefront-3.4.41 app/controllers/workarea/storefront/user_activity.rb
workarea-storefront-3.4.40 app/controllers/workarea/storefront/user_activity.rb
workarea-storefront-3.4.39 app/controllers/workarea/storefront/user_activity.rb
workarea-storefront-3.4.38 app/controllers/workarea/storefront/user_activity.rb
workarea-storefront-3.4.37 app/controllers/workarea/storefront/user_activity.rb
workarea-storefront-3.4.36 app/controllers/workarea/storefront/user_activity.rb
workarea-storefront-3.4.35 app/controllers/workarea/storefront/user_activity.rb
workarea-storefront-3.4.34 app/controllers/workarea/storefront/user_activity.rb
workarea-storefront-3.4.33 app/controllers/workarea/storefront/user_activity.rb
workarea-storefront-3.4.32 app/controllers/workarea/storefront/user_activity.rb
workarea-storefront-3.4.31 app/controllers/workarea/storefront/user_activity.rb
workarea-storefront-3.4.30 app/controllers/workarea/storefront/user_activity.rb
workarea-storefront-3.4.29 app/controllers/workarea/storefront/user_activity.rb
workarea-storefront-3.4.28 app/controllers/workarea/storefront/user_activity.rb
workarea-storefront-3.4.27 app/controllers/workarea/storefront/user_activity.rb
workarea-storefront-3.4.26 app/controllers/workarea/storefront/user_activity.rb