Estava tentando executar o rspec em plugins, e foi o que obtive:
Parece ter sido introduzido aqui:
Pode faltar base.attribute :chat_send_shortcut, :integer, default: 0?
Estava tentando executar o rspec em plugins, e foi o que obtive:
Parece ter sido introduzido aqui:
Pode faltar base.attribute :chat_send_shortcut, :integer, default: 0?
Eu encontrei esse mesmo problema ao adicionar um novo enum. Acontece que eu tinha que executar explicitamente as migrações do plugin para o ambiente de teste:
RAILS_ENV=test LOAD_PLUGINS=1 bin/rails db:migrate
Ah, interessante. Eu pensei que db:migrate incluiria os plugins por padrão.
De fato, eu tinha várias migrações aguardando pelos plugins em RAILS_ENV=test.
O erro sumiu agora, obrigado!
EDIT:
Na verdade, se você usar RAILS_ENV=test bin/rake db:migrate, note o “bin/”, ele define LOAD_PLUGINS para 1.

Você pode ver o conteúdo de bin/rake:
if ENV['RAILS_ENV'] == 'test' && ENV['LOAD_PLUGINS'].nil?
if ARGV.include?('db:migrate') || ARGV.include?('parallel:migrate')
STDERR.puts "You are attempting to run migrations in your test environment and are not loading plugins, setting LOAD_PLUGINS to 1"
ENV['LOAD_PLUGINS'] = '1'
end
end
Em algum momento, provavelmente parei de digitar “bin/” por preguiça
.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.