uuidable 0.2.0 → 0.2.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
  SHA1:
3
- metadata.gz: 20a81bfd257b2ccc14fcf0d5534cf959dd312e02
4
- data.tar.gz: 80d2fd04ee3c6d969c46737ec209e6673fb07a64
3
+ metadata.gz: 6bef2a8c5b3ba999fc584d96ab54ca6ea9bfef1f
4
+ data.tar.gz: cebd3fe34711866eb84f227f0fd41f7b3ffe7d87
5
5
  SHA512:
6
- metadata.gz: 826e63ce56cedda8472dda13aaa4032786263743bf9f88fe3ff5a530afba6d9261de75dbed7a4a2f57bf887672f1a653766a8c60957f9cad06b4501c30d6a5d4
7
- data.tar.gz: 8c20370fe8c1b20d91e3a96e66deefc6bbe9145ded75024999b363241c0a0029c3bb975fc65da40f28952e6d59f6fcf43c414f61d3dc2ac9ad9d452c5a6ce9d6
6
+ metadata.gz: 9c3e598c79ecfa411932a1b272e31b88e487939e57b0205e08f8b00b32259389a391cce265cea8da36ff716d46f60647a3170b42c8096c662796dceb552fd7d5
7
+ data.tar.gz: b3dfd81d70a19fa9243f1268107aa077c4cbbe906ead773bfb414f53bff62ecfe174ae00682b4b6201d15aaf3992c282dffa28a990a8486b43a3aa8e0cea724a
@@ -7,7 +7,7 @@ module Uuidable
7
7
  # Module adds method to table definition
8
8
  module TableDefinition
9
9
  def uuid(opts = {})
10
- index_opts = opts.delete(:index)
10
+ index_opts = opts.delete(:index) || {}
11
11
  column_name = opts.delete(:column_name) || COLUMN_NAME
12
12
 
13
13
  column column_name, COLUMN_TYPE, COLUMN_OPTIONS.merge(opts)
@@ -19,11 +19,13 @@ module Uuidable
19
19
  module Migration
20
20
  def add_uuid_column(table_name, opts = {})
21
21
  index_opts = opts.delete(:index)
22
+ index_opts = {} if index_opts == true
23
+
22
24
  column_name = opts.delete(:column_name) || COLUMN_NAME
23
25
 
24
26
  add_column table_name, column_name, COLUMN_TYPE, COLUMN_OPTIONS.merge(opts)
25
27
 
26
- add_uuid_index(index_opts.merge(column_name: column_name)) unless index_opts == false
28
+ add_uuid_index(table_name, index_opts.merge(column_name: column_name)) unless index_opts.nil?
27
29
  end
28
30
 
29
31
  def add_uuid_index(table_name, opts = {})
@@ -1,3 +1,3 @@
1
1
  module Uuidable
2
- VERSION = '0.2.0'.freeze
2
+ VERSION = '0.2.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uuidable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Gnuskov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-04 00:00:00.000000000 Z
11
+ date: 2017-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler