Created
July 27, 2010 20:04
-
-
Save robyurkowski/492776 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
So I have a model named Droplet. A droplet is essentially a catch-all status update. It looks like this: | |
Droplet | |
------- | |
- id | |
- title:varchar(255) | |
- body:varchar(255) | |
- user_id:int(11) | |
The body field stores each status update. In order to keep the interface simple, the boss wants to be able to just keep typing in the same text field when he wants to create a blog entry. Back-end code (which isn't REALLY the issue here; I know how to implement either solution) checks the length of the posted body param. If it's longer than 255 characters, it stores it as a blog entry. Otherwise, it stores it in the body attribute. | |
The question at hand is: | |
1. Do I add an additional field to Droplet -- i.e. 'blog:blob', and store the text data there? | |
2. Do I create a separate model named Blog and relate it to a Droplet via has_one? This has the added bonus of letting me call Blog.all later. | |
I have to keep the Droplet item loading reasonably quick. Other than that, I'm welcome to suggestions as to which I choose. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment