declare_schema 0.12.0.pre.2 → 0.12.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: e55426213e7d15730b0531d3dba4036a4b18f3967b73a7619e60f27d15fc5b55
4
- data.tar.gz: 294eef4ce49c912df24403ab59998e61641c681ea1e98fa6c9fa00d66a4c4502
3
+ metadata.gz: 741e1030227b2cd6e472d1f3cc9a8f3838c927b3702087428f01b2af09a7c758
4
+ data.tar.gz: 439d95f21fd5e8f677aea5c1ef4bb52fc37c8321b0066876f0970028e75a654a
5
5
  SHA512:
6
- metadata.gz: 3a3ebaa029176ff322a396baf65aaca878f631ae3ac0acad2a2290fc73275c56c312a00e1423219a30055f39ca17f1873a55f0d8be8a4dfeb38f821718c57128
7
- data.tar.gz: 25d48b29e96b5508b52c07ca869221d506f05370a38af76994a33bbfcb67153f379b9605a60e9169876bebb63e6db5bf9acbf1f09aab900d03fc05be404cd643
6
+ metadata.gz: b332745b815b6ac442158727c4d6ded6f320144f40b895ff4e303bd0e67a25d305fbed845ab3eedb9d49754078fff0f2b25b58f417fd42e00552b58b4bd67d1a
7
+ data.tar.gz: 600fb3635f8a65defcb0643501553e73befc7548da6a6821840b3a487c80e66a0933f51cbde7a83679a2ac2dc69f7f54e71aab2d878dd03b9742308cb0d845f5
data/CHANGELOG.md CHANGED
@@ -4,7 +4,7 @@ Inspired by [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
5
  Note: this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
- ## [0.12.0] - Unreleased
7
+ ## [0.12.0] - 2021-04-28
8
8
  ### Added
9
9
  - `belongs_to` now always infers the `limit:` of the foreign key to match that of the primary key it points to.
10
10
  Note: this isn't possible for polymorphic foreign keys, so it assumes `limit: 8` there...unless the schema
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- declare_schema (0.12.0.pre.2)
4
+ declare_schema (0.12.0)
5
5
  rails (>= 4.2)
6
6
 
7
7
  GEM
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DeclareSchema
4
- VERSION = "0.12.0.pre.2"
4
+ VERSION = "0.12.0"
5
5
  end
@@ -343,16 +343,15 @@ module Generators
343
343
 
344
344
  db_columns = model.connection.columns(current_table_name).index_by(&:name)
345
345
  if (pk = model._declared_primary_key.presence)
346
- key_was_in_db_columns = db_columns.delete(pk)
346
+ pk_was_in_db_columns = db_columns.delete(pk)
347
347
  end
348
348
 
349
349
  model_column_names = model.field_specs.keys.map(&:to_s)
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 if pk && !key_was_in_db_columns
353
+ to_add << pk if pk && !pk_was_in_db_columns
354
354
  to_remove = db_column_names - model_column_names
355
- to_remove -= [pk.to_sym] if pk # TODO: The .to_sym here means this code is always a no-op, right? -Colin
356
355
 
357
356
  to_rename = extract_column_renames!(to_add, to_remove, new_table_name)
358
357
 
@@ -40,8 +40,6 @@ RSpec.describe 'DeclareSchema API' do
40
40
  load_models
41
41
 
42
42
  if ActiveSupport::VERSION::MAJOR == 5
43
- # TODO: get this to work on Travis for Rails 6
44
- # TODO: uncomment since we're not on Travis any more? -Colin
45
43
  generate_migrations '-n', '-m'
46
44
  end
47
45
 
@@ -50,8 +48,6 @@ RSpec.describe 'DeclareSchema API' do
50
48
 
51
49
  ## The Basics
52
50
 
53
- # The main feature of DeclareSchema, aside from the migration generator, is the ability to declare rich types for your fields. For example, you can declare that a field is an email address, and the field will be automatically validated for correct email address syntax.
54
-
55
51
  ### Field Types
56
52
 
57
53
  # Field values are returned as the type you specify.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: declare_schema
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0.pre.2
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Invoca Development adapted from hobo_fields by Tom Locke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-27 00:00:00.000000000 Z
11
+ date: 2021-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails