merit-gem / merit

Reputation engine for Rails apps
Other
1.53k stars 198 forks source link

Fix typo in active_record/merit_generator.rb #345

Closed jlholm closed 4 years ago

jlholm commented 4 years ago

Line#16 of the lib/merit/generators/active_record/merit_generator.rb class 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: https://github.com/merit-gem/merit/issues/344

Working example:

root@b16ac38735ed:/app# rails g merit:active_record:merit lectures
Running via Spring preloader in process 354
      create  db/migrate/20200613030255_add_merit_fields_to_lectures.rb

Generated template:

root@b16ac38735ed:/app# cat db/migrate/20200613030255_add_merit_fields_to_lectures.rb
class AddMeritFieldsToLectures < ActiveRecord::Migration[6.0]
  def change
    add_column :lectures, :sash_id, :integer
    add_column :lectures, :level,   :integer, :default => 0
  end
end
coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 91.098% when pulling e2663adb752c554f7a2686baf60258e926558553 on jlholm:fix-typo-in-ar-merit-generator into bde91e04387488d6d4172688a551b43e33eed28a on merit-gem:master.

tute commented 4 years ago

Thanks for finding and fixing this! :-)