lib/generators/scenic/view/templates/db/migrate/update_view.erb in scenic-1.6.0 vs lib/generators/scenic/view/templates/db/migrate/update_view.erb in scenic-1.7.0
- old
+ new
@@ -1,12 +1,13 @@
class <%= migration_class_name %> < <%= activerecord_migration_class %>
def change
+ <% method_name = replace_view? ? 'replace_view' : 'update_view' %>
<%- if materialized? -%>
- update_view <%= formatted_plural_name %>,
+ <%= method_name %> <%= formatted_plural_name %>,
version: <%= version %>,
revert_to_version: <%= previous_version %>,
materialized: <%= no_data? ? "{ no_data: true }" : true %>
<%- else -%>
- update_view <%= formatted_plural_name %>, version: <%= version %>, revert_to_version: <%= previous_version %>
+ <%= method_name %> <%= formatted_plural_name %>, version: <%= version %>, revert_to_version: <%= previous_version %>
<%- end -%>
end
end