Skip to content

excluded_models does not works with db:setup #664

@kuzukuzu

Description

@kuzukuzu

Steps to reproduce

Configure excluded models.

Apartment.configure do |config|
  config.excluded_models = ["Company"]
end

db/seeds.rb is as below.

Company.create

Apartment::Tenant.create('some_tenant') do
  puts "companies: #{Company.count}"
end

And call db:setup. (assume that 'public' tenant does not exist)

rails db:setup

Outputs this.

companies: 0

Expected behavior

excluded_models have effect also in db:setup.

Actual behavior

excluded_models have no effect in db:setup.

System configuration

  • Database: mysql 5.6

  • Apartment version: 2.2.1

  • Apartment config (in config/initializers/apartment.rb or so):

    • use_schemas: default (true)
    • prepend_environment: true
  • Rails (or ActiveRecord) version: 5.2.4.5

  • Ruby version: 2.5.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions