anonymous_active_record 1.0.2 → 1.0.3

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: 1902988838c6ae1533726ada1fcd5d708c37caa7afea6bbafc84f0b3ada4c77d
4
- data.tar.gz: c223e3d53de54e44058cb574f07bc9deb77959de1278b1cf799371f1a1ebc87b
3
+ metadata.gz: b0c82662e8af866d1743315b3a68a9b76fc6658b2a22ed48642b307c204ad067
4
+ data.tar.gz: 74a221bcf95cb888be5729aef71838919835fb2b20bef8caa0338ab619484542
5
5
  SHA512:
6
- metadata.gz: 10cea43713751bfdd6e888821f89ef65b90fb482895ff2950c65d934278f73565f7a90c084692b6362b17f047ea098ccefacd26fb28077ed420095d3bc59df9f
7
- data.tar.gz: 767e23e51229dba5fdaab7014f241121b67bf17ea6acd84f7b39192df3d9e2d27c3ae324d1a5d6daced603ed8a2cfef4b269061bb65b96decbffe9f6aee8939f
6
+ metadata.gz: 6737111961bdc7ec78a05bf51cc7c16f7a6f08569a3f96d4f64bc993f9b80cdf1f57c84fa4736ed06b750b92e9b97176ae12a4800dd287d6b19013a1ec0505f1
7
+ data.tar.gz: 2cb6992f6a210d06d13e5fd4c4a8dacd79a8c3e38b5c1dff04ccb014f3b9c2c07375217417ad743df8c0b65f5cb0f6a888ee65c900d3a3cf9ed8457a8029f832
@@ -53,18 +53,26 @@ module AnonymousActiveRecord
53
53
  # :name and :type are required at minimum
54
54
  name = col.delete(:name)
55
55
  type = col.delete(:type)
56
- if col.empty?
57
- t.column(name, type)
58
- else
59
- t.column(name, type, **col)
60
- end
56
+ t.column(name, type, col)
57
+ elsif col.is_a?(Array)
58
+ t.column col[0], col[-1] || :string
61
59
  else
62
60
  t.column col, :string
63
61
  end
64
62
  end
65
63
  indexes.each do |idx_options|
66
- column_names = idx_options.delete(:columns)
67
- t.index column_names, **idx_options
64
+ if idx_options.is_a?(Hash)
65
+ column_names = idx_options.delete(:columns)
66
+ t.index column_names, idx_options
67
+ elsif idx_options.is_a?(Array)
68
+ if idx_options.length == 1
69
+ t.index idx_options[0]
70
+ else
71
+ t.index idx_options[0], idx_options[-1]
72
+ end
73
+ else
74
+ t.index idx_options
75
+ end
68
76
  end
69
77
  t.timestamps if timestamps
70
78
  end
@@ -1,3 +1,3 @@
1
1
  module AnonymousActiveRecord
2
- VERSION = '1.0.2'.freeze
2
+ VERSION = '1.0.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anonymous_active_record
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Boling