activerecord-rdb-adapter 0.4.1 → 0.5.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: eae56962a83ba7f51da156eb041ef6b9961e450d29088e2481b3085c4913d1b8
4
- data.tar.gz: 38fcc781c4852ef2dd1897d0affebaac9006e038dbb90a67efe4ba9995a4e408
3
+ metadata.gz: 93f60ce721782365089749c21271eee0ea9fee532ca54952b0cebc6f07e8e980
4
+ data.tar.gz: 3e49ca60c171d759964f2ad4cc11efc7fb709b543d05a2db3d80310eb95c1920
5
5
  SHA512:
6
- metadata.gz: 1f68f8293992979c5f6168746cabed86d7c68290424aa566134db01e40cf3ec9097e53628c05bf71906197ebaeb4f6dec9271a062ba6e9d6b4b6050e00ebd064
7
- data.tar.gz: c5dc9601b8205894ca3f668f25848643a69b79093b2069d87d9a60e2d80eb889f77e00b465e797ee765fea0d77b8c5eeb5746776017ca0a5d432c153f6b94890
6
+ metadata.gz: 5036b2be9ea51e5de77c1212f460a6fbeac1ba9741b89845ce9f0ad54da579f1552dfb5a32c759a41b11a3b80abf58d94fcd6ec190562fc1131bb30b59b8e83c
7
+ data.tar.gz: c2c8340eaca31424bb34513910b62e07e06ab17be578f2e9035eb2ae7728f58a0b9b5866cc4f683b8f354fea34c02878bb937143ecfcf0739fcad13a44580806
@@ -74,7 +74,8 @@ module ActiveRecord
74
74
  private
75
75
 
76
76
  def id_value_for_database(value)
77
- if primary_key = value.class.primary_key
77
+ primary_key = value.class.primary_key
78
+ if primary_key
78
79
  value.instance_variable_get(:@attributes)[primary_key].value_for_database
79
80
  end
80
81
  end
@@ -15,7 +15,7 @@ module ActiveRecord
15
15
  def add_column_options!(sql, options)
16
16
  sql << " DEFAULT #{quote_default_expression(options[:default], options[:column])}" if options_include_default?(options)
17
17
  # must explicitly check for :null to allow change_column to work on migrations
18
- if !options[:null]
18
+ unless options[:null]
19
19
  sql << " NOT NULL"
20
20
  end
21
21
  if options[:auto_increment]
@@ -80,12 +80,14 @@ module ActiveRecord
80
80
 
81
81
  def drop_table(name, options = {}) # :nodoc:
82
82
  drop_sql = "DROP TABLE #{quote_table_name(name)}"
83
- if options[:if_exists]
84
- drop = !execute(squish_sql(<<-END_SQL))
85
- select 1 from rdb$relations where rdb$relation_name = #{quote_table_name(name).tr('"', '\'')}
86
- END_SQL
87
- .empty?
88
- end
83
+ drop = if options[:if_exists]
84
+ !execute(squish_sql(<<-END_SQL))
85
+ select 1 from rdb$relations where rdb$relation_name = #{quote_table_name(name).tr('"', '\'')}
86
+ END_SQL
87
+ .empty?
88
+ else
89
+ false
90
+ end
89
91
 
90
92
  trigger_name = "N$#{name.upcase}"
91
93
  drop_trigger(trigger_name) if trigger_exists?(trigger_name)
@@ -269,7 +271,8 @@ module ActiveRecord
269
271
  string_to_sql(limit)
270
272
  else
271
273
  type = type.to_sym if type
272
- if native = native_database_types[type]
274
+ native = native_database_types[type]
275
+ if native
273
276
  column_type_sql = (native.is_a?(Hash) ? native[:name] : native).dup
274
277
 
275
278
  if type == :decimal # ignore limit, use precision and scale
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-rdb-adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Lobanov (RedSoft)