lib/trice/controller_methods.rb in trice-0.1.1 vs lib/trice/controller_methods.rb in trice-0.2.0
- old
+ new
@@ -1,14 +1,19 @@
+require 'trice/controller_methods/raw_reference_time'
require 'trice/controller_methods/reference_time_assignment'
require 'trice/controller_methods/stub_configuration'
module Trice
module ControllerMethods
extend ActiveSupport::Concern
included do |controller|
if controller.ancestors.include?(ActionController::Base)
+ unless controller.middleware_stack.include?(RawReferenceTime)
+ controller.use RawReferenceTime
+ end
+
config = StubConfiguration.new(Trice.support_requested_at_stubbing)
prepend_around_action ReferenceTimeAssignment.new(config)
helper_method :requested_at
hide_action :requested_at