rspeckled 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8fe74e754785c816902f45bb183ccb508cd4f083c1a4b7936aad5515ccbb7e07
4
- data.tar.gz: 33272063f72e86e7c57e13c9d77630f3487b00c0298a70c089f20c80af520c55
3
+ metadata.gz: c55403f64a71c1a54c6be017e8e0a3be7ba3ce7d9d33ebbdc76faa0592565250
4
+ data.tar.gz: 0c2486cfd81fe7685d7e3adc5d07cbf920aae936eca7fd3f0e8d450caf23b023
5
5
  SHA512:
6
- metadata.gz: 9ee06b9533d6eb4e680cb4a5a5d3e7929f0787c2b0ef76872dd90924d04012599d1d670dd83375d64dc889782c249ec7da02f02fb8ef3e0724702e2bd5d53ca6
7
- data.tar.gz: b6ae744f8db4e05cff9118c9dce7748536b449780c788b8a6081f320c6f781947e8fba0d731f03e461bd66e280511d6edb1c377aa4365d3fe9a3db290f385a83
6
+ metadata.gz: e4fb5c23ceabbb4679a5b13f24e4e1918428ec889682168396a0b027cf462c06f9935663410b1a2ec2614d52975d3d878e8d6f4241ed53cbd48a9e22f2bafe07
7
+ data.tar.gz: 30d3dd97d15dd19f094b68affdfe1e77adda8ab3b99c982d1ed8cd0f33fcc130cfaf9264b8a087e1d2d8d4adb52d49811cb7e8f027c2d55652c797f92990e47d
checksums.yaml.gz.sig CHANGED
Binary file
@@ -39,15 +39,13 @@ RSpec.configure do |config|
39
39
  HEREDOC
40
40
 
41
41
  unless options[:tables] == :all
42
- foreign_key_names_sql += 'AND ('
42
+ foreign_key_names_sql += " AND\n"
43
43
 
44
- table_constraint_sql = options[:tables].map do |table_name|
45
- %Q{"pg_class"."relname" = '#{table_name}'}
46
- end
44
+ table_constraint_sql = options[:tables]
45
+ .map { |table_name| "'#{table_name}'" }
46
+ .join(', ')
47
47
 
48
- foreign_key_names_sql += table_constraint_sql.join(' OR ')
49
-
50
- foreign_key_names_sql += ')'
48
+ foreign_key_names_sql += %Q{ "pg_class"."relname" IN (#{table_constraint_sql})}
51
49
  end
52
50
 
53
51
  foreign_keys_to_disable = ::ActiveRecord::Base.connection.select_values(foreign_key_names_sql).join(',')
@@ -55,7 +53,7 @@ RSpec.configure do |config|
55
53
  if foreign_keys_to_disable.blank?
56
54
  puts 'You asked to disable foreign keys but there were no foreign keys found to disable'
57
55
  else
58
- ::ActiveRecord::Base.connection.execute('SET CONSTRAINTS %<key_pattern>s DEFERRED' % { :key_pattern => foreign_keys_to_disable }) unless foreign_keys_to_disable.empty?
56
+ ::ActiveRecord::Base.connection.execute('SET CONSTRAINTS %<key_pattern>s DEFERRED' % { :key_pattern => foreign_keys_to_disable })
59
57
  end
60
58
 
61
59
  example.run
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rspeckled
4
- VERSION = '1.2.0'
4
+ VERSION = '1.2.1'
5
5
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspeckled
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - thegranddesign
@@ -35,7 +35,7 @@ cert_chain:
35
35
  eUgMp+qKjyM1NGj/222soSUpWqOE16L23vv8sWIbMIADdR8dephQ6jMovYylUmE5
36
36
  KHp+JJQviSN0i4z8gVL2zloo+xZf791LiJH8Kcjpx43jhg0WdR4=
37
37
  -----END CERTIFICATE-----
38
- date: 2018-11-04 00:00:00.000000000 Z
38
+ date: 2018-11-10 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: rspec
metadata.gz.sig CHANGED
Binary file