lib/generators/metka/strategies/view/templates/migration.rb.erb in metka-0.1.0 vs lib/generators/metka/strategies/view/templates/migration.rb.erb in metka-0.1.1
- old
+ new
@@ -4,10 +4,10 @@
def up
execute <<-SQL
CREATE OR REPLACE VIEW <%= view_name %> AS
SELECT UNNEST
- ( <%= source_column_name %> ) AS name,
+ ( <%= source_column_name %> ) AS <%= source_column_name.singularize %>_name,
COUNT ( * ) AS taggings_count
FROM
<%= source_table_name %>
GROUP BY
name;