As my Rails application matures, it becomes increasingly apparent that it has a strong data warehouse flavor, not having just a fact table to make everything explicit.
In addition, I just read chapters 2 (Designing beautiful APIs) and 3 (Mastering dynamic tools) of Ruby Best Practices .
Now I'm trying to figure out how best to create a fact-extracting part ...
Let's say I have the following sizes (existing models in the application):
- Product (contains funds)
- Fund
- Measurement (e.g. general holding, medium holding, medium exposure)
... and the good old universal fact:
- Fact (date, value plus NULLable column with foreign key for each of my dimensions)
Some aspects that I would be grateful for are some tips:
- What could be a flexible search interface?
- What happens if I have Facts with both NULL (i.e., all and without them) and NOT NULL (specific) values for the dimension? Pseudo meaning like
:all? Or should any convention apply? - How to select only a subset of dimension values? Or exclude a subset ?: only and: exclude?
- Has anyone had experience creating
named_scopeto handle this? There is the obvious attraction of being able to bind one for each aspect of interest, but does it make it too awkward if we get to 7 or 8 dimensions?
( , acts_as_fact, , - ( , RailsConf 2006 ), , .)
: Rails, ActiveRecord 2.1.2, Oracle Enhanced Adapter 1.2.0
EDIT: ActiveWarehouse :
- 2008 , 09 ;
- 2006 , , 404s ;
- , ActiveRecord - AR, , AR-.
, , !