Closed jnicho02 closed 5 years ago
Filters are kind of meant to be free formed compared to anything else. Plus, filters can be for any column you want on any fact model and may also result in additional joins.
While fact models/tables, dimensions, etc follow a specific naming schema by default, you can make filters whatever you want. This is mainly due to the term "dimension filter" not really existing in OLAP.
Fair enough about flexibility, but as a new user the first filter I tried was something simple and it surprised me by not working out-of-the-box in a similar way to dimension. I'm certainly not expecting more complex filters to work without setup. Pls close the issue if you feel it cannot/shouldn't be done. Or leave open to be implemented later
Dimension successfully defaults to using 'name', maybe a dimension_filter should do so as well.
e.g. assuming I have
dimension :player
in my FactModel, asking fordimension_filter: {player: 'Jez'}
would filter on player.name = 'Jez'.... it would not require addingdimension_filter :player, ->(x) { joins(:player).where(players: {name: x}) }
to the model.