aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorTeddy Wing2018-01-24 17:01:42 +0100
committerZog2018-01-25 17:18:02 +0100
commitc02c597cfcd8d21c9bf59d41dbd312e9c26289b8 (patch)
treeec76fa7f6bc7b43df03e764175d9b04abef2ac5a /lib
parent5e41dbed021522331532eb0151ac441553be2d13 (diff)
downloadchouette-core-c02c597cfcd8d21c9bf59d41dbd312e9c26289b8.tar.bz2
PurchaseWindowDecorator: Convert to new action links interface
Also add a new method `AF83::Decorator.define_instance_method`. Thanks to Johan for suggesting that and walking me through writing it. This new method allows us to define methods on the instance decorator. We need this to preserve the `#bounding_dates` method that was defined in `PurchaseWindowDecorator`. Refs #5586
Diffstat (limited to 'lib')
-rw-r--r--lib/af83/decorator.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/af83/decorator.rb b/lib/af83/decorator.rb
index e83e03e0f..1b9574053 100644
--- a/lib/af83/decorator.rb
+++ b/lib/af83/decorator.rb
@@ -28,6 +28,10 @@ class AF83::Decorator < ModelDecorator
end
end
+ def self.define_instance_method method_name, &block
+ instance_decorator.send(:define_method, method_name, &block)
+ end
+
class ActionLinks
attr_reader :options