I have an mysql table called "info_item", which can be extended with a mongodb document:
class CreateInfoItems < ActiveRecord::Migration
def change
create_table :info_items do |t|
t.integer :machine_id
t.binary :external_id
t.integer :info_type_id
t.timestamps null: false
end
end
end
The field "external_id" is going to be an id of a mongodb document.
How can I represent it in my model?
I thought about an object which is inherited from ActiveRecord::Base and includes the Mongoid::Document:
class InfoItem < ActiveRecord::Base
end
class PhoneNumber < InfoItem
include Mongoid::Document
end
Is it going to run? Do you have other ideas?