Commit 270578d4e717dcc8365077d7ade29da1138d0f47
1 parent
097861a1
Exists in
staging
and in
31 other branches
stoa: fix pessoa table creation
Showing
2 changed files
with
6 additions
and
6 deletions
Show diff stats
plugins/stoa/test/functional/account_controller_test.rb
... | ... | @@ -6,15 +6,15 @@ class AccountControllerTest < ActionController::TestCase |
6 | 6 | SALT=YAML::load(File.open(StoaPlugin.root_path + 'config.yml'))['salt'] |
7 | 7 | |
8 | 8 | @db = Tempfile.new('stoa-test') |
9 | - configs = ApplicationRecord.configurations['stoa'] = {:adapter => 'sqlite3', :database => @db.path} | |
10 | - ApplicationRecord.establish_connection(:stoa) | |
9 | + ActiveRecord::Base.configurations['stoa'] = {:adapter => 'sqlite3', :database => @db.path} | |
10 | + ActiveRecord::Base.establish_connection(:stoa) | |
11 | 11 | ActiveRecord::Schema.verbose = false |
12 | 12 | ActiveRecord::Schema.create_table "pessoa" do |t| |
13 | 13 | t.integer "codpes" |
14 | 14 | t.text "numcpf" |
15 | 15 | t.date "dtanas" |
16 | 16 | end |
17 | - ApplicationRecord.establish_connection(:test) | |
17 | + ActiveRecord::Base.establish_connection(:test) | |
18 | 18 | StoaPlugin::UspUser.reset_column_information |
19 | 19 | |
20 | 20 | def setup | ... | ... |
plugins/stoa/test/unit/usp_user_test.rb
... | ... | @@ -5,15 +5,15 @@ class StoaPlugin::UspUserTest < ActiveSupport::TestCase |
5 | 5 | SALT=YAML::load(File.open(StoaPlugin.root_path + 'config.yml'))['salt'] |
6 | 6 | |
7 | 7 | @db = Tempfile.new('stoa-test') |
8 | - configs = ApplicationRecord.configurations['stoa'] = {:adapter => 'sqlite3', :database => @db.path} | |
9 | - ApplicationRecord.establish_connection(:stoa) | |
8 | + ActiveRecord::Base.configurations['stoa'] = {:adapter => 'sqlite3', :database => @db.path} | |
9 | + ActiveRecord::Base.establish_connection(:stoa) | |
10 | 10 | ActiveRecord::Schema.verbose = false |
11 | 11 | ActiveRecord::Schema.create_table "pessoa" do |t| |
12 | 12 | t.integer "codpes" |
13 | 13 | t.text "numcpf" |
14 | 14 | t.date "dtanas" |
15 | 15 | end |
16 | - ApplicationRecord.establish_connection(:test) | |
16 | + ActiveRecord::Base.establish_connection(:test) | |
17 | 17 | StoaPlugin::UspUser.reset_column_information |
18 | 18 | |
19 | 19 | def setup | ... | ... |