Sha256: 33cc3496b4fc67e94e379b1c02519b952a55dca31a461b30b794b8b74cbbeb10

Contents?: true

Size: 423 Bytes

Versions: 13

Compression:

Stored size: 423 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
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
workarea-storefront-3.4.24 app/controllers/workarea/storefront/user_activity.rb
workarea-storefront-3.4.23 app/controllers/workarea/storefront/user_activity.rb
workarea-storefront-3.4.22 app/controllers/workarea/storefront/user_activity.rb
workarea-storefront-3.4.21 app/controllers/workarea/storefront/user_activity.rb
workarea-storefront-3.4.20 app/controllers/workarea/storefront/user_activity.rb
workarea-storefront-3.4.19 app/controllers/workarea/storefront/user_activity.rb
workarea-storefront-3.4.18 app/controllers/workarea/storefront/user_activity.rb
workarea-storefront-3.4.17 app/controllers/workarea/storefront/user_activity.rb
workarea-storefront-3.4.16 app/controllers/workarea/storefront/user_activity.rb
workarea-storefront-3.4.15 app/controllers/workarea/storefront/user_activity.rb
workarea-storefront-3.4.14 app/controllers/workarea/storefront/user_activity.rb
workarea-storefront-3.4.13 app/controllers/workarea/storefront/user_activity.rb
workarea-storefront-3.4.12 app/controllers/workarea/storefront/user_activity.rb