scenic
scenic copied to clipboard
Allows you to override the root path directly on a per-instance basis
This helps in situations where you are creating or updating views from within a Rails engine. By adding the root_path
to the statement it will be able to correctly find the file.
The , root_path: Database::Engine.root
is the part that is manually added. I didn't find any method of autodetecting the rails engine so this would have to be manually added after generating the migration.
Solves the issue I brought up in #261
create_view
create_view :product_stats, version: 2, root_path: Database::Engine.root
update_view
update_view :product_stats, version: 2, revert_to_version: 1, root_path: Database::Engine.root
replace_view
replace_view :product_stats, version: 2, revert_to_version: 1, root_path: Database::Engine.root