pg_saurus 5.1.0 → 5.3.0

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: 4a5ce70db53d9b1636c43b1e2156bc88eeabebf62fbeb39e9ea6141bec719eb3
4
- data.tar.gz: '058c5db2a699fba1f9bec20a0136e4fef2721f03a30b8fc74d1a83197dc20f21'
3
+ metadata.gz: e4dfa9fa5e2ea0cf5c38fc323434ff9a8e2fd0fc051adf45e378d31d09bfd3bb
4
+ data.tar.gz: db821a3566aea980399af5d4178771d42b7aac460549905e8f2765690e930562
5
5
  SHA512:
6
- metadata.gz: 4909fe1c8a4694daf48598534b9d4e0dac565224be24c055187e1fe1a125e542f48fbbd4af646b81d4cf7c2a729b56712f6687abfc5106386e302abdfbf105ed
7
- data.tar.gz: a647b93cd3c8ac24b62c9accf944fa1874d7a902a0129eea64e2f3bf20361f855eff2ed5ee0bb18e66055bf8210a8e8aff1d6da38d663eb4679616a5c436f138
6
+ metadata.gz: 8b5c252cba03504a37fb499a6c38fb7a97807025ff3aa0e9574a12036fa1583b7d4307d5398a3aaa0dda2979a764a5d7af3c8a96da80e6ae7d399c268b234e75
7
+ data.tar.gz: c5b8a0629e1a25d53e52f57451e9efa54f8e31a5b8abab97f0b1de624eca446893785a53e2b54d372bb0a0f1e83fd128cd0bb27badc816d5fd093a57e35cc762
@@ -225,7 +225,7 @@ module ActiveRecord
225
225
  end
226
226
 
227
227
  # Override super method to provide support for expression column names.
228
- def quoted_columns_for_index(column_names, **options)
228
+ def quoted_columns_for_index(column_names, options = {})
229
229
  return [column_names] if column_names.is_a?(String)
230
230
 
231
231
  quoted_columns = Hash[
@@ -5,14 +5,16 @@ module PgSaurus::ConnectionAdapters::AbstractAdapter::SchemaMethods
5
5
  # Provide :schema option to +create_table+ method.
6
6
  def create_table(table_name, options = {}, &block)
7
7
  table_name, options = extract_table_options(table_name, options)
8
- super(table_name, options, &block)
8
+ super(table_name, **options, &block)
9
9
  end
10
10
 
11
11
  # Provide :schema option to +drop_table+ method.
12
12
  def drop_table(table_name, options = {})
13
- super(*extract_table_options(table_name, options))
13
+ table_name, options = extract_table_options(table_name, options)
14
+ super(table_name, **options)
14
15
  end
15
16
 
17
+ # Extract the table-specific options for the given table name from the options.
16
18
  def extract_table_options(table_name, options)
17
19
  options = options.dup
18
20
  schema_name = options.delete(:schema)
@@ -34,7 +34,7 @@ module PgSaurus # :nodoc:
34
34
  " Use :exclude_index => true when adding the foreign key."
35
35
  end
36
36
 
37
- super from_table, to_table, options
37
+ super from_table, to_table, **options
38
38
 
39
39
  unless exclude_index
40
40
  add_index from_table, column
@@ -44,14 +44,14 @@ module PgSaurus # :nodoc:
44
44
  # See activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
45
45
  #
46
46
  # Pass in the option remove_index: true to remove index as well.
47
- def remove_foreign_key(from_table, options_or_to_table = {})
48
- if options_or_to_table.is_a?(Hash) && options_or_to_table[:remove_index]
49
- column = options_or_to_table[:column]
47
+ def remove_foreign_key(from_table, to_table = nil, **options)
48
+ if options[:remove_index]
49
+ column = options[:column]
50
50
  remove_index from_table, column
51
- options_or_to_table.delete(:remove_index)
51
+ options.delete(:remove_index)
52
52
  end
53
53
 
54
- super(from_table, options_or_to_table)
54
+ super(from_table, to_table, **options)
55
55
  end
56
56
 
57
57
  # See: activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
@@ -27,7 +27,7 @@ module PgSaurus::ConnectionAdapters::PostgreSQLAdapter::SchemaMethods
27
27
  options = options.dup
28
28
  schema_name = options.delete(:schema)
29
29
  table_name = "#{schema_name}.#{table_name}" if schema_name
30
- super(table_name, options)
30
+ super(table_name, **options)
31
31
  end
32
32
 
33
33
  # Make method +tables+ return tables not only from public schema.
@@ -15,7 +15,7 @@ module PgSaurus::SchemaDumper::FunctionMethods
15
15
  # Writes out a command to create each detected function.
16
16
  def dump_functions(stream)
17
17
  @connection.functions.each do |function|
18
- statement = " create_function '#{function.name}', :#{function.returning}, <<-FUNCTION_DEFINITION.gsub(/^[\s]{4}/, ''), volatility: :#{function.volatility}"
18
+ statement = " create_function '#{function.name}', '#{function.returning}', <<-FUNCTION_DEFINITION.gsub(/^[\s]{4}/, ''), volatility: :#{function.volatility}"
19
19
  statement << "\n#{function.definition.split("\n").map{|line| " #{line}" }.join("\n")}"
20
20
  statement << "\n FUNCTION_DEFINITION\n\n"
21
21
 
@@ -1,4 +1,4 @@
1
1
  module PgSaurus
2
2
  # Version of pg_saurus gem.
3
- VERSION = "5.1.0"
3
+ VERSION = "5.3.0"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_saurus
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.0
4
+ version: 5.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Potapov Sergey
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2022-01-06 00:00:00.000000000 Z
16
+ date: 2022-07-09 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: pg