Sha256: e1fb3740cbe0c294bc44a321dcb5853bf383f2729d8637dceaf3b8deebc4303c

Contents?: true

Size: 855 Bytes

Versions: 6

Compression:

Stored size: 855 Bytes

Contents

module Administrate
  module Generators
    # This class serves only to work around a strange behaviour in Rails 7
    # with Ruby 3.
    #
    # After running the spec for DashboardGenerator, the fake models that
    # it generates (eg: Foo, Shipment) linger around despite being removed
    # explicitly. This causes RouteGenerator to take them into
    # account and generate routes for them, which its spec doesn't expect,
    # causing a spec failure.
    #
    # To avoid this, the spec for DashboardGenerator defines its fake models
    # as children of TestRecord. Then RoutesGenerator explicitly filters
    # child classes of TestRecord when figuring out what models exist.
    #
    # Discussion at https://github.com/thoughtbot/administrate/pull/2324
    class TestRecord < ApplicationRecord
      self.abstract_class = true
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
administrate-1.0.0.beta3 lib/generators/administrate/test_record.rb
administrate-1.0.0.beta2 lib/generators/administrate/test_record.rb
administrate-1.0.0.beta1 lib/generators/administrate/test_record.rb
administrate-0.20.1 lib/generators/administrate/test_record.rb
administrate-0.20.0 lib/generators/administrate/test_record.rb
administrate-0.19.0 lib/generators/administrate/test_record.rb