Skip to content

Commit

Permalink
Fixed custom message model - fixes #115
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Oct 17, 2018
1 parent fbe46cc commit 8c6f1e0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.3 [unreleased]

- Fixed custom message model

## 1.0.2

- Fixed error with Ruby < 2.5
Expand Down
4 changes: 3 additions & 1 deletion lib/ahoy_email.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ module AhoyEmail

self.preserve_callbacks = []

self.message_model = -> { ::Ahoy::Message }

def self.message_model
model = (defined?(@message_model) && @message_model) || ::Ahoy::Message
model = defined?(@@message_model) && @@message_model
model = model.call if model.respond_to?(:call)
model
end
Expand Down

0 comments on commit 8c6f1e0

Please sign in to comment.