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,15 +6,15 @@ class AccountControllerTest < ActionController::TestCase | ||
6 | SALT=YAML::load(File.open(StoaPlugin.root_path + 'config.yml'))['salt'] | 6 | SALT=YAML::load(File.open(StoaPlugin.root_path + 'config.yml'))['salt'] |
7 | 7 | ||
8 | @db = Tempfile.new('stoa-test') | 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 | ActiveRecord::Schema.verbose = false | 11 | ActiveRecord::Schema.verbose = false |
12 | ActiveRecord::Schema.create_table "pessoa" do |t| | 12 | ActiveRecord::Schema.create_table "pessoa" do |t| |
13 | t.integer "codpes" | 13 | t.integer "codpes" |
14 | t.text "numcpf" | 14 | t.text "numcpf" |
15 | t.date "dtanas" | 15 | t.date "dtanas" |
16 | end | 16 | end |
17 | - ApplicationRecord.establish_connection(:test) | 17 | + ActiveRecord::Base.establish_connection(:test) |
18 | StoaPlugin::UspUser.reset_column_information | 18 | StoaPlugin::UspUser.reset_column_information |
19 | 19 | ||
20 | def setup | 20 | def setup |
plugins/stoa/test/unit/usp_user_test.rb
@@ -5,15 +5,15 @@ class StoaPlugin::UspUserTest < ActiveSupport::TestCase | @@ -5,15 +5,15 @@ class StoaPlugin::UspUserTest < ActiveSupport::TestCase | ||
5 | SALT=YAML::load(File.open(StoaPlugin.root_path + 'config.yml'))['salt'] | 5 | SALT=YAML::load(File.open(StoaPlugin.root_path + 'config.yml'))['salt'] |
6 | 6 | ||
7 | @db = Tempfile.new('stoa-test') | 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 | ActiveRecord::Schema.verbose = false | 10 | ActiveRecord::Schema.verbose = false |
11 | ActiveRecord::Schema.create_table "pessoa" do |t| | 11 | ActiveRecord::Schema.create_table "pessoa" do |t| |
12 | t.integer "codpes" | 12 | t.integer "codpes" |
13 | t.text "numcpf" | 13 | t.text "numcpf" |
14 | t.date "dtanas" | 14 | t.date "dtanas" |
15 | end | 15 | end |
16 | - ApplicationRecord.establish_connection(:test) | 16 | + ActiveRecord::Base.establish_connection(:test) |
17 | StoaPlugin::UspUser.reset_column_information | 17 | StoaPlugin::UspUser.reset_column_information |
18 | 18 | ||
19 | def setup | 19 | def setup |