I have two models, User and Person. Basically users are users of the system while people is a kind of address book. But every user is also a person so I created this relationship:
class User < ActiveRecord::Base
class Person < ActiveRecord::Base
Now, on creating a user I want to automatically create a person. Is this the way to do it:
if person.nil? && person_id.nil?
self.person = Person.create!(:name => email, :tenant => tenant)