ankane / ahoy_email

First-party email analytics for Rails
MIT License
1.11k stars 137 forks source link

Overriding message model not working as intended #115

Closed mrsweaters closed 6 years ago

mrsweaters commented 6 years ago

In my initializer I am setting the following:

AhoyEmail.message_model = -> { MyModel }

But this doesn't seem to work as I receive the following message in the console:

> AhoyEmail.message_model
=> Ahoy::Message(Table doesn't exist)

I would expect this to return MyModel.

I'm also getting this error when sending emails:

ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR:  relation "ahoy_messages" does not exist
LINE 8:                WHERE a.attrelid = '"ahoy_messages"'::regclas...
ankane commented 6 years ago

Hey @mrsweaters, thanks for reporting 👍 Fixed on master.

mrsweaters commented 6 years ago

So fast! Thanks!