app/controllers/ahoy/messages_controller.rb in ahoy_email-1.0.3 vs app/controllers/ahoy/messages_controller.rb in ahoy_email-1.1.0
- old
+ new
@@ -1,15 +1,11 @@
module Ahoy
class MessagesController < ApplicationController
filters = _process_action_callbacks.map(&:filter) - AhoyEmail.preserve_callbacks
- if Rails::VERSION::MAJOR >= 5
- skip_before_action(*filters, raise: false)
- skip_after_action(*filters, raise: false)
- skip_around_action(*filters, raise: false)
- else
- skip_action_callback *filters
- end
+ skip_before_action(*filters, raise: false)
+ skip_after_action(*filters, raise: false)
+ skip_around_action(*filters, raise: false)
before_action :set_message
def open
if @message && !@message.opened_at
@@ -23,10 +19,10 @@
end
def click
if @message && !@message.clicked_at
@message.clicked_at = Time.now
- @message.opened_at ||= @message.clicked_at
+ @message.opened_at ||= @message.clicked_at if @message.respond_to?(:opened_at=)
@message.save!
end
user_signature = params[:signature].to_s
url = params[:url].to_s