lib/generators/pay/orm_helpers.rb in pay-2.7.0 vs lib/generators/pay/orm_helpers.rb in pay-2.7.1

- old
+ new

@@ -1,16 +1,10 @@ # frozen_string_literal: true module Pay module Generators module OrmHelpers - def model_contents - <<-CONTENT - include Pay::Billable - CONTENT - end - private def model_exists? File.exist?(File.join(destination_root, model_path)) end @@ -27,9 +21,19 @@ end end def model_path @model_path ||= File.join("app", "models", "#{file_path}.rb") + end + + def migration_version + if rails5_and_up? + "[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]" + end + end + + def rails5_and_up? + Rails::VERSION::MAJOR >= 5 end end end end