I have two model, Event and EventDetail
class Event < ActiveRecord::Base
has_one :event_detail, :class_name => 'EventDetail', :foreign_key =>
class EventDetail < ActiveRecord::Base
belongs_to :event, :class_name => 'Event', :foreign_key =>
The schema in ssc_event.event_id is an identity column.
The schema in ssc_event_detail.event_id is an integer column
I use the following ruby code to insert a new record, but I think it is
a = Event.new
a.cluster_code = "KWC"
a.hosp_code = "CMC"
b = EventDetail.new
b.id = a.id.to_i
b.detail = "This is detail"
Any one have a better solution? Please share.