I have a rails 3 devise app has users with a profile and privacy settings. I currently have this working, but am concerned about efficiency and would love the advice of an experienced rails dev.
I generated User model with devise and scaffolded out Profile and Privacy models to contain items deemed not required for sign up. I would like the the User to have different settings links.
Account Settings => Devise - just required login type stuff, username, password Profile Settings => Profile model - description, avatar, birthday etc. Privacy Settings => Privacy model - checkboxes that control basic hiding/showing of the user's profile fields.
I have set up my relationships:
user.rb
has_one :profile
has_one :privacy
profile.rb
belongs_to :user
privacy.rb
belongs_to :user
This seems horribly inefficient to me. To display the profile I am relying on loading three tables: users, profiles, and privacies.
I think that all of the table columns from Profile and Privacy should be contained in the users table, would this make more sense? How would I separate the different forms?
My one thought was to just add a profile method and a privacy method to the users controller, than I could make profile and privacy templates in my users views. with different forms controlling the different portions of the user record that each would edit.
Does this make sense? Would this make more sense than separate scaffolds like I currently have?