Seirie - thanks for the response!

Matt - you are right about the typos - featureable_type in Features 
would be referring to "property" rather than "property.id" and 
Feature_Data should have a field "value." The ERD is correct. I set this 
up as polymorphic since at least two more models will have Features: 
Units and Rooms.

I broke out Features into two models (Features and Feature_Data) for two 
reasons: I wanted to normalize the feature titles and wanted to have 
data_type which could record whether the data is an integer, boolean, 
string, etc. (since I assume I will have to store everything in 
Feature_Data as a string and convert back using rails) - a real pain!

Thinking through it again, since I would have an "unlimited" number of 
features available through a polymorphic association, maybe I should 
make all the data boolean and rework as such: (is there a more graceful 
way?)

Properties
id
yadda yadda

Properties_Features
property_id
feature_id

Features
id
featurable_type (polymorphic - property, unit, or room)
title
value (boolean, always true?)

-- 
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 rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to