Sha256: cad8096516b2d1584e3bc31a6d8a47f7d97831485c44b65c7824f449ce7c6c70
Contents?: true
Size: 778 Bytes
Versions: 4
Compression:
Stored size: 778 Bytes
Contents
# frozen_string_literal: true module SolidusFriendlyPromotions module Conditions class User < Condition include OrderLevelCondition has_many :condition_users, class_name: "SolidusFriendlyPromotions::ConditionUser", foreign_key: :condition_id, dependent: :destroy has_many :users, through: :condition_users, class_name: Spree::UserClassHandle.new def preload_relations [:users] end def eligible?(order, _options = {}) users.include?(order.user) end def user_ids_string user_ids.join(",") end def user_ids_string=(user_ids) self.user_ids = user_ids.to_s.split(",").map(&:strip) end def updateable? true end end end end
Version data entries
4 entries across 4 versions & 1 rubygems