declare_schema 0.12.0.pre.1 → 0.12.0.pre.2

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: e1353d236bb050d93155e56eab2bf5e5d31da06338970b13278c07ed86ac3180
4
- data.tar.gz: f70054b7f56fd18264abe2e719167a2d83ebaa143279dc784dfcaf16b4cb4514
3
+ metadata.gz: e55426213e7d15730b0531d3dba4036a4b18f3967b73a7619e60f27d15fc5b55
4
+ data.tar.gz: 294eef4ce49c912df24403ab59998e61641c681ea1e98fa6c9fa00d66a4c4502
5
5
  SHA512:
6
- metadata.gz: 7e541c39b62bf7228842f20830ae52d1b49dca66a6a834f38478cc3320aa65dea1c7b85becbcc75edf7382470e7bdf0bc9949a3665e72ff778a26aaae65ae15a
7
- data.tar.gz: f3bdcaad7b1aa8341d168c5d10461737b54e7781dfadce2da26e289f2ca3192b6dd9775bdb8c99a040b17ba415be2725fcbd3451c518c96e901227f2572cf95c
6
+ metadata.gz: 3a3ebaa029176ff322a396baf65aaca878f631ae3ac0acad2a2290fc73275c56c312a00e1423219a30055f39ca17f1873a55f0d8be8a4dfeb38f821718c57128
7
+ data.tar.gz: 25d48b29e96b5508b52c07ca869221d506f05370a38af76994a33bbfcb67153f379b9605a60e9169876bebb63e6db5bf9acbf1f09aab900d03fc05be404cd643
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- declare_schema (0.12.0.pre.1)
4
+ declare_schema (0.12.0.pre.2)
5
5
  rails (>= 4.2)
6
6
 
7
7
  GEM
@@ -6,9 +6,9 @@ module DeclareSchema
6
6
  module SchemaChange
7
7
  class ColumnAdd < Base
8
8
  def initialize(table_name, column_name, column_type, **column_options)
9
- @table_name = table_name
10
- @column_name = column_name
11
- @column_type = column_type
9
+ @table_name = table_name or raise ArgumentError, "must provide table_name"
10
+ @column_name = column_name or raise ArgumentError, "must provide column_name"
11
+ @column_type = column_type or raise ArgumentError, "must provide column_type"
12
12
  @column_options = column_options
13
13
  end
14
14
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DeclareSchema
4
- VERSION = "0.12.0.pre.1"
4
+ VERSION = "0.12.0.pre.2"
5
5
  end
@@ -350,7 +350,7 @@ module Generators
350
350
  db_column_names = db_columns.keys.map(&:to_s)
351
351
 
352
352
  to_add = model_column_names - db_column_names
353
- to_add += [pk] unless key_was_in_db_columns
353
+ to_add << pk if pk && !key_was_in_db_columns
354
354
  to_remove = db_column_names - model_column_names
355
355
  to_remove -= [pk.to_sym] if pk # TODO: The .to_sym here means this code is always a no-op, right? -Colin
356
356
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: declare_schema
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0.pre.1
4
+ version: 0.12.0.pre.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Invoca Development adapted from hobo_fields by Tom Locke