lib/generators/notable/requests_generator.rb in notable-0.2.0 vs lib/generators/notable/requests_generator.rb in notable-0.2.1

- old
+ new

@@ -20,10 +20,16 @@ "%.3d" % next_migration_number end end def copy_migration - migration_template "create_requests.rb", "db/migrate/create_notable_requests.rb" + migration_template "create_requests.rb", "db/migrate/create_notable_requests.rb", migration_version: migration_version + end + + def migration_version + if ActiveRecord::VERSION::MAJOR >= 5 + "[#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}]" + end end end end end