Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- table=car
- oid, something, something_else, ...
- has many properties -> car_properties
- table=car_properties
- oid, car_id, keyname, value, ...
- belongs to car
- @car = Car.first
- @car.something = something
- @car.someprop = something
- class CarProperty < ActiveRecord::Base
- set_primary_key :oid
- belongs_to :car
- end
- class Car < ActiveRecord::Base
- set_table_name :car
- set_primary_key :oid
- has_many :car_properties
- accepts_nested_attributes_for :car_properties
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement