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
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:
class Person < ActiveRecord::Base composed_of :name, :class_name => "Name", :mapping => [ # database ruby %w[ first_name first_name ], %w[ last_name last_name ] ], end class Name attr_accessor :first_name, :last_name end
You'll then have to add two database columns ( first_name, last_name ).