Hi to all,
I've 3 simple (I hope) questions about rails application design:
1. I'm developing a RoR application with some tables, every table has a boolean column (is_active), this column/property determines if the object is active or not. My question is "what is the best practice to implement this kind of problem ?":
1.1 - Have boolean is_active on each table with one base class ? (but without STI because every class/table have separated content...) 1.2 - Have an interface "Activable" on a separate table with a single boolean column is_active then in every table create an active object through activable interface ? 1.3 - Other solutions ?
2. On the same application all the tables/objects belongs to customer (multi site app) my question is "is it correct to propagate the customer_id foreign key to all the tables or is it better to have a "customerable" interface and link all the objects with has_one :customer through customerable ?
3. Last question: is it a good practice writing modular applications in which each one works only with a specialized database and handles linked restful resources from other applications ? Ex. News application handles only the news database and news objects, security application handles only the security database and security objects (in this scenario is it possible to have map.resources news, :as_one => security where security objects don't belong to the same application ?)
Many thanks in advance and happy programming with Ruby On Rails !