I can’t think of anything other than explicitly referencing the constants of the models which the view depends on.
If this list were passed into ActiveRecordViews, it could raise an error if there were any dependencies not listed (detectable via PostgreSQL after the view is created). This would act as a safety feature.
The list would have to be specified either as a part of the is_view call (probably as an options hash) or as another new method called before the is_view call (e.g. view_dependency). I am headed towards an option on is_view (e.g. is_view dependencies: [Foo]).
I can’t think of anything other than explicitly referencing the constants of the models which the view depends on.
If this list were passed into ActiveRecordViews, it could raise an error if there were any dependencies not listed (detectable via PostgreSQL after the view is created). This would act as a safety feature.
The list would have to be specified either as a part of the
is_view
call (probably as an options hash) or as another new method called before theis_view
call (e.g.view_dependency
). I am headed towards an option onis_view
(e.g.is_view dependencies: [Foo]
).