I want to extend Conversation model, so that i can use an association with it. I have done it by creating a file named 'conversation.rb' in app/models directory in this way:
Mailboxer::Conversation.class_eval do
belongs_to :device, class_name: "Device", foreign_key: 'device_id'
end
I have also added a column named 'device_id' in conversations table.
But when i tries:
Conversation.last.device
It say:
NoMethodError: undefined method `device' for #<Mailboxer::Conversation:0x007fe83e6ae7c0>