This really is much more of an over-all design question, but it will likely be implemented in RoR that I'm greatly just starting out. Also, I believe this really is my first question so be gentle :)
The scenario is:
I've an Resource model. Each resource is situated inside a specific room, and so i would like a 1-to-many relationship having a Location model. Not so difficult. However, some rooms (Locations) also pass an alias (eg. 123 is also known as Library). Whenever a user really wants to update details about a specific Resource, I'd like these to have the ability to just look without having to worry about whether or not they be aware of exact room number, and become proven a listing of assets for the reason that room.
To explain, there might be several alias.
So now you ask ,:
Can you recommend an Alias model that an area might have a 1-to-many relationship? Or, would a self-referential (sort-of hierarchical) association be superior? Or something like that else maybe? From things i can envisage, the previous would require querying posts on different tables for the similar kind of information, and also the latter just does not appear right (an Alias is different then an area).
This can be a great position for while using marking wordpress plugin functions-as-taggable-on:
Inside your model that you can do:
class Location < ActiveRecord::Base acts_as_taggable_on :aliases end
Then inside your controller do:
Location.tagged_with("library", :on => :aliases)