webdack-uuid_migration 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- M2Y5MTYzM2UyMzU0ZmEyNTU0Y2IyMWE4NmU0ODUyMWI4YjMyMDU4Yw==
4
+ OWM1NjE0ZDIxOTg0MGNlM2Q4NTIxNzRkNzY2NDFhODFiYmJkNjEyMw==
5
5
  data.tar.gz: !binary |-
6
- ODMyMWJlOWNmOTYzMTkwYWEyM2E3YmM5NzM1OThkZWUyOGIzMjI4MQ==
6
+ MzkwYzI3YmYyNjJkOGFjM2Y5M2NjM2ExNTQ5ZTdiMWY1MmY0ODA2NQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OTJhOThlN2RhZTZiZWU2OWVhZWU2YWM1MjkzNDdiN2JlNWE0ZmUxODJhZDZi
10
- ZmRhNjRlYjVmNzRlMThiMTYxZjUyM2JkN2ExOGE5MGM1YjUxODI4N2MzYWVk
11
- M2I0NDMyY2I5ODVkYjgyOTE1ODAyOWU2MzNlOTY1YTdjZTg4YTg=
9
+ OTc5NWY5NDNmYmVmZjg1NTdhZGFjOTVlZmQ0OTQ0Nzk1MTcyZTM2OGMyNDRh
10
+ MzNmNTY0ODM3YmM1NjY1NGVmNTYxNWI4M2QwNTBlNDQ0MWQ4MzVjNWY2MDc5
11
+ MmFmYzc2NjcwMTVlZWFjNDU5YzI3MzJhOTMzZjQzZDVhMDUwMzI=
12
12
  data.tar.gz: !binary |-
13
- ZTQwMmJjZTkxZmY1MDJmOWUyNDBmYjE4MjU2MjViMTg2MzgxZTdkNjc2MzM5
14
- ZWE4MGY2ZWUxOWU5ZWU1NDMwODFjMjZkNDQ1MGRjOGQ5MjQzYzgwYWZhZjA0
15
- OThhZjAxOTI4MDNjZGM5OTYxZjZiNTNmNTI3YmIxN2NhZDVlNWI=
13
+ MTJiNWQ5Y2ZhZGYwZTgzZjNkNTZjNmE3ZTY0ZTZhYWVkYWViYzhhNzhiYmE1
14
+ MDUzOTEzYWViMjc0NDE0YzIxMjk2YjU3YTcyOTE3MThjNTNkMmY1ODI5ZTRk
15
+ ZTU3YzExYmNkNjZkNGY2N2UzNTc5NTQwZDg2NThmMDE5NDBhMjE=
data/.gitignore CHANGED
@@ -3,6 +3,7 @@
3
3
  .bundle
4
4
  .config
5
5
  .yardoc
6
+ .idea
6
7
  Gemfile.lock
7
8
  InstalledFiles
8
9
  _yardoc
data/README.md CHANGED
@@ -19,14 +19,14 @@ Or install it yourself as:
19
19
 
20
20
  ## Usage
21
21
 
22
- - Put `require 'webdack/uuid_migration/helper'` in your migration file.
22
+ - Put `require 'webdack/uuid_migration/helpers'` in your migration file.
23
23
  - Enable `'uuid-ossp'` directly in Postgres database or by adding `enable_extension 'uuid-ossp'` to your migration.
24
24
  - Use methods from {Webdack::UUIDMigration::Helpers} as appropriate.
25
25
 
26
26
  Example:
27
27
 
28
28
  # You must explicitly require it in your migration file
29
- require 'webdack/uuid_migration/helper'
29
+ require 'webdack/uuid_migration/helpers'
30
30
 
31
31
  class UuidMigration < ActiveRecord::Migration
32
32
  def change
@@ -89,7 +89,8 @@ Example:
89
89
 
90
90
  ## Compatibility
91
91
 
92
- Works only with Rails 4. It uses Rails4's out-of-the-box UUID support for PostgreSQL. Works with Ruby 1.9.3 and 2.0.0.
92
+ Works only with Rails 4. It uses Rails4's out-of-the-box UUID support for PostgreSQL. Works with Ruby 1.9.3,
93
+ 2.0.0, and 2.1.1.
93
94
 
94
95
  To run the test suite:
95
96
 
@@ -2,6 +2,6 @@
2
2
  module Webdack
3
3
  #
4
4
  module UUIDMigration
5
- VERSION = "0.0.2"
5
+ VERSION = "0.0.3"
6
6
  end
7
7
  end
@@ -89,7 +89,7 @@ describe Webdack::UUIDMigration::Helpers do
89
89
 
90
90
  def key_relationships
91
91
  [
92
- Student.order(:name).map { |s| [s.name, s.city.name, s.institution.name] },
92
+ Student.order(:name).map { |s| [s.name, s.city ? s.city.name : nil, s.institution ? s.institution.name : nil] },
93
93
  City.order(:name).map { |c| [c.name, c.students.order(:name).map(&:name)] },
94
94
  School.order(:name).map { |s| [s.name, s.students.order(:name).map(&:name)] },
95
95
  College.order(:name).map { |c| [c.name, c.students.order(:name).map(&:name)] }
@@ -153,6 +153,17 @@ describe Webdack::UUIDMigration::Helpers do
153
153
  }
154
154
  end
155
155
 
156
+ it 'should handle nulls' do
157
+ Student.create(name: 'Student without city or institution')
158
+
159
+ expect {
160
+ MigrateAllOneGo.migrate(:up)
161
+ reset_columns_data
162
+ }.to_not change {
163
+ key_relationships
164
+ }
165
+ end
166
+
156
167
  it 'should migrate in steps for polymorphic association' do
157
168
  expect {
158
169
  MigrateStep01.migrate(:up)
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["deepak@kreatio.com"]
11
11
  spec.summary = %q{Useful helpers to migrate Integer id columns to UUID in PostgreSql.}
12
12
  spec.description = %q{Useful helpers to migrate Integer id columns to UUID in PostgreSql. Special support for primary keys.}
13
- spec.homepage = ""
13
+ spec.homepage = "https://github.com/kreatio-sw/webdack-uuid_migration"
14
14
  spec.license = 'MIT'
15
15
 
16
16
  spec.files = `git ls-files`.split($/)
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
  spec.add_development_dependency "rspec"
25
25
  spec.add_development_dependency "pg"
26
26
 
27
- spec.add_dependency 'activerecord', '~> 4.0.0'
27
+ spec.add_dependency 'activerecord', '~> 4.0'
28
28
 
29
29
  spec.has_rdoc= 'yard'
30
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webdack-uuid_migration
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Deepak Kumar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-25 00:00:00.000000000 Z
11
+ date: 2014-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - ~>
88
88
  - !ruby/object:Gem::Version
89
- version: 4.0.0
89
+ version: '4.0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - ~>
95
95
  - !ruby/object:Gem::Version
96
- version: 4.0.0
96
+ version: '4.0'
97
97
  description: Useful helpers to migrate Integer id columns to UUID in PostgreSql. Special
98
98
  support for primary keys.
99
99
  email:
@@ -121,7 +121,7 @@ files:
121
121
  - spec/uuid_custom_pk_spec.rb
122
122
  - spec/uuid_migrate_helper_spec.rb
123
123
  - webdack-uuid_migration.gemspec
124
- homepage: ''
124
+ homepage: https://github.com/kreatio-sw/webdack-uuid_migration
125
125
  licenses:
126
126
  - MIT
127
127
  metadata: {}