class CreateTickets < ActiveRecord::Migration[5.1]
def change
create_table :tickets do |t|
t.jsonb :settings
t.string :name
t.timestamps
end
end
end
class Ticket < ApplicationRecord
belongs_to :location, store: :settings, optional: true
end
Ticket.create! name: "test", settings: {location_id: 1}