Skip to main content
Looking for advice on how to setup a relationship.
Databases Solved • Asked by Morgan
I'm trying to figure out the best way to setup relationships between models which allows users to publish saved content from multiple models. **ExampIe:** I have a **Post** model which allows...

Polymorphic, STI, or something else?
Databases • Asked by Billy Purdy
I am working on an app for a real estate company. There will be 2 resources, Listings and Rentals. They will have a lot of the same data (address, beds, baths, sqft, etc.) but also different (r...

How do I update value from one scaffold with the value of another scaffold?
Databases Solved • Asked by Tatiane Stivelman
I'm doing a project that contains a stock, I first created the stock scaffold like this: ``` rails generate scaffold stock name:string amount:float kind:string ``` And then a stock_flow sca...

Handle schema changes and data changes using migrations?
Databases • Asked by Tabish Iqbal
ashley [2:18 PM] What are different strategies folks use for handling _schema changes_ and _data changes_ and using *migrations*? *Once you have a production system running but need to do schema...

How Do I Create an App Where Each User Has A Separate Table
Databases Solved • Asked by Vikram Sharma
Hi, I want to create a web app which is a simple HR SaaS. Each user/company which registers will have get a separate table to upload list of employees. In terms of autorization a user/company ca...

How to transform this spreadsheet into a database model - see example code
Databases • Asked by Sebastian
Hi everyone! I have to transform this spreadsheet [Spreadsheet]( into database model. This spreadsheet is par...

Incorrect setup for Model associations
Databases • Asked by Masud Hossain
I feel these associations are incorrectly set up. It's a bit similar to Trello, except I'm adding in a 'client' model too. The main part that's confusing to me is the fact user.rb, it's just buggin...

What could be the best way to deal with addresses in terms of database structure and perfomance?
Databases • Asked by Carlos Orellana
I'm creating an app for my company. In that application there are a lot of addresses because for Owner, Store, Landlord, etc needs to have address. At first I was thinking to create separate mod...

Are there any WORM (write once, read many) data stores that integrate well with Rails?
Databases • Asked by Chris Zempel
I've gotta store a bunch of events, which are snippets of data that contain information about a thing that happened inside the system I'm working on. I'm building out audit trail, which could poten...

Is it better to create 'duplicate' inverse join records or traverse via ruby/rails?
Databases • Asked by Thomas Bush
I am buidling an application for real estate centered around comparing properties. I have a self referential relationship, Comps, which joins two properties and stores some additional data. G...