coming from my experience with nHibernate, I wonder how one maps (n)hibernate’s component classes in ActiveRecord
class Person < ActiveRecord::Base
#somehow get a :name attribute here
end
class Name
@fist_name
@last_name
end
how can this be done with one table only (so this is no 1:1, but i want to have a :name_first_name column in the db (or whatever the convention is)?
That’s what composed_of is for.
For You example:
You’ll then have to add two database columns ( first_name, last_name ).