6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'app/models/concerns/solidus_promotions/conditions/line_item_level_condition.rb', line 6
def self.included(base)
def base.method_added(method)
if method == :eligible?
Spree.deprecator.warn <<~MSG
Defining `eligible?` on a promotion along with including the `LineItemLevelCondition` module is deprecated.
Rename `eligible?` to `line_item_eligible?` and stop including the `LineItemLevelCondition` module.
MSG
define_method(:applicable?) do |promotable|
promotable.is_a?(Spree::LineItem)
end
end
super
end
end
|