diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8883abc..5995fbb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: [ '3.0', '3.1', '3.2' ] + ruby: [ '3.0', '3.1', '3.2', '3.3' ] rails: [ '6.1', '7.0', '7.1' ] name: SQLite / Ruby ${{ matrix.ruby }} / Rails ${{ matrix.rails }} @@ -58,7 +58,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: [ '3.0', '3.1', '3.2' ] + ruby: [ '3.0', '3.1', '3.2', '3.3' ] rails: [ '6.1', '7.0', '7.1' ] name: MySQL / Ruby ${{ matrix.ruby }} / Rails ${{ matrix.rails }} @@ -107,7 +107,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: [ '3.0', '3.1', '3.2' ] + ruby: [ '3.0', '3.1', '3.2', '3.3' ] rails: [ '6.1', '7.0', '7.1' ] name: PostgreSQL / Ruby ${{ matrix.ruby }} / Rails ${{ matrix.rails }} diff --git a/lib/generators/unread/migration/migration_generator.rb b/lib/generators/unread/migration/migration_generator.rb index e197c9b..3684340 100644 --- a/lib/generators/unread/migration/migration_generator.rb +++ b/lib/generators/unread/migration/migration_generator.rb @@ -13,11 +13,22 @@ def create_migration_file end def self.next_migration_number(dirname) - if ActiveRecord::Base.timestamped_migrations + if self.timestamped_migrations? Time.now.utc.strftime("%Y%m%d%H%M%S") else "%.3d" % (current_migration_number(dirname) + 1) end end + + def self.timestamped_migrations? + ( + ActiveRecord::Base.respond_to?(:timestamped_migrations) && + ActiveRecord::Base.timestamped_migrations + ) || + ( + ActiveRecord.respond_to?(:timestamped_migrations) && + ActiveRecord.timestamped_migrations + ) + end end end diff --git a/lib/unread/version.rb b/lib/unread/version.rb index a8141b8..8339375 100644 --- a/lib/unread/version.rb +++ b/lib/unread/version.rb @@ -1,3 +1,3 @@ module Unread - VERSION = '0.13.0' + VERSION = '0.13.1' end