Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typo in active_record/merit_generator task #344

Closed
jlholm opened this issue Jun 13, 2020 · 0 comments
Closed

Typo in active_record/merit_generator task #344

jlholm opened this issue Jun 13, 2020 · 0 comments

Comments

@jlholm
Copy link
Contributor

jlholm commented Jun 13, 2020

👋 - Just getting started with Merit (thanks for your work!)

I noticed there was a typo in the active_record/merit_generator.rb task which prevents the template from being generated, subsequently preventing the task from running successfully.

migration_template 'add_merit_fields_to_model.rb',

I believe the template name should reference the add_merit_fields_to_model.erb template:

class AddMeritFieldsTo<%= table_name.camelize %> < ActiveRecord::Migration<%= migration_version %>
def change
add_column :<%= table_name %>, :sash_id, :integer
add_column :<%= table_name %>, :level, :integer, :default => 0
end
end

I ran into this issue when trying to add merit_fields to one of my models.

Local error:

root@b16ac38735ed:/app# rails g merit:active_record:merit <model>
Could not find "add_merit_fields_to_model.rb" in any of your source paths. Your current source paths are:
/bundle/gems/merit-4.0.0/lib/merit/generators/active_record/templates

I can fix this is you'd like, just let me know. Thanks again!

jlholm added a commit to jlholm/merit that referenced this issue Jun 13, 2020
Line merit-gem#16 was referring to the migration_template source as 'add_merit_fields_to_model.rb'.
This source does not exist as the actual extension is `.erb`. This caused the task
to fail as there is no template with the name 'add_merit_fields_to_model.rb'.

Resolving: merit-gem#344
@tute tute closed this as completed in 294fd12 Jun 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant