Given the following situation:
client belongs_to entity
entity has_one client
entity has_one vendor
entity has_many contacts
entity has_many sites
Creating a new client should test if an entity with the existing name is
already on file and return it if so, else the process should create a
new entity with identically named attributes in entity passed the
initial values from client.
I think that this sort of complexity belongs in the client model but I
am open to arguments as to where else it might go.
Is there a recommended Rails approach that deals with this situation?
Should I do all this creating and initializing in a before_create