Hello Friends,

I am trying to define relationship between real-world entities in my
application.... But I am feel, I am over-representing it a little and
hence would like your opinion.

class User < ActiveRecord::Base
  has_and_belongs_to_many :user_groups

  attr_accessible :username, :email, :password, :password_confirmation

end

class Customer < User
  has_many :orders

  belongs_to :person
end

class Employee < User
  belongs_to :person

end

class Person < ActiveRecord::Base
  has_many :addresses
end


Should I merge User and Person Models? Basically user has only login
information while Person has details like first_name, last_name, address
and so on....

Also, should Customer and Employee inherit from Person or User? Trying
to normalize stuff but dont want to over-normalize it too..

Thank you.
-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to