Javid Freeman

Joined

160 Experience
1 Lesson Completed
0 Questions Solved

Activity

Posted in When to setup associations in Rails db?

I've always wondered if there is a better way to help database query performance in rails by breaking up tables with lots of columns? Any recommendations would be appreciated.

Does it make more sense to break out columns into another table or keep them in one?

Example: 

Client.name
Client.address
Client.city
Client.state
Client.zip
Client.twitter
Client.facebook
Client.instagram
Client.contact_name
Client.contact_phone
Client.contact_email
etc...

VS

Client.name

has_one :address
Client.address.address
Client.address.city
Client.address.state
Client.address.zip

has_one :social
Client.social.twitter
Client.social.facebook
Client.social.instagram

has_one :contact
Client.contact.name
Client.contact.phone
Client.contact.email


Posted in Environment setup: iTerm, dotfiles etc

echo $PS1 ??

I like your command prompt. Thanks

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

© 2024 GoRails, LLC. All rights reserved.