talentbox-sequel-rails 0.3.7 → 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile.lock +1 -1
- data/History.md +10 -1
- data/lib/sequel-rails/railties/database.rake +9 -8
- data/lib/sequel-rails/version.rb +1 -1
- metadata +3 -3
data/Gemfile.lock
CHANGED
data/History.md
CHANGED
@@ -1,6 +1,15 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.9 - dev
|
2
2
|
===========
|
3
3
|
|
4
|
+
0.3.8
|
5
|
+
=====
|
6
|
+
|
7
|
+
* Fix bug in `db:force_close_open_connections` and make it work with
|
8
|
+
PostgreSQL 9.2.
|
9
|
+
* Ensure `db:test:prepare` use `execute` instead of `invoke` so that tasks
|
10
|
+
already invoked are executed again. This make the following work as expected:
|
11
|
+
`rake db:create db:migrate db:test:prepare`
|
12
|
+
|
4
13
|
0.3.7
|
5
14
|
=====
|
6
15
|
|
@@ -142,13 +142,14 @@ namespace :db do
|
|
142
142
|
|
143
143
|
desc 'Forcibly close any open connections to the test database'
|
144
144
|
task :force_close_open_connections => :environment do
|
145
|
-
if
|
145
|
+
if db_for_current_env.database_type==:postgres
|
146
146
|
begin
|
147
|
-
#Will only work on Postgres > 8.4
|
147
|
+
# Will only work on Postgres > 8.4
|
148
|
+
pid_column = db_for_current_env.server_version < 90200 ? "procpid" : "pid"
|
148
149
|
db_for_current_env.execute <<-SQL.gsub(/^\s{9}/,'')
|
149
|
-
SELECT COUNT(pg_terminate_backend(
|
150
|
+
SELECT COUNT(pg_terminate_backend(#{pid_column}))
|
150
151
|
FROM pg_stat_activity
|
151
|
-
WHERE datname = '#{
|
152
|
+
WHERE datname = '#{db_for_current_env.opts[:database]}';
|
152
153
|
SQL
|
153
154
|
rescue => e
|
154
155
|
#Will raise an error as it kills existing process running this command
|
@@ -160,10 +161,10 @@ namespace :db do
|
|
160
161
|
namespace :test do
|
161
162
|
task :prepare => "db:abort_if_pending_migrations" do
|
162
163
|
Rails.env = 'test'
|
163
|
-
Rake::Task['db:force_close_open_connections'].
|
164
|
-
Rake::Task['db:drop'].
|
165
|
-
Rake::Task['db:create'].
|
166
|
-
Rake::Task['db:schema:load'].
|
164
|
+
Rake::Task['db:force_close_open_connections'].execute
|
165
|
+
Rake::Task['db:drop'].execute
|
166
|
+
Rake::Task['db:create'].execute
|
167
|
+
Rake::Task['db:schema:load'].execute
|
167
168
|
Sequel::DATABASES.each do |db|
|
168
169
|
db.disconnect
|
169
170
|
end
|
data/lib/sequel-rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: talentbox-sequel-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -191,7 +191,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
191
191
|
version: '0'
|
192
192
|
segments:
|
193
193
|
- 0
|
194
|
-
hash:
|
194
|
+
hash: -412832233955601598
|
195
195
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
196
196
|
none: false
|
197
197
|
requirements:
|
@@ -200,7 +200,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
200
200
|
version: '0'
|
201
201
|
segments:
|
202
202
|
- 0
|
203
|
-
hash:
|
203
|
+
hash: -412832233955601598
|
204
204
|
requirements: []
|
205
205
|
rubyforge_project:
|
206
206
|
rubygems_version: 1.8.24
|