schema_plus 1.8.5 → 1.8.6

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: b9a8707ec7f02b04de258e6ff545d03b1104b49c
4
- data.tar.gz: b0188b5c1f872ade4d5f154e3c30bd3cb28ae998
3
+ metadata.gz: ed2c43411e4ae250a4e15339b46e0e176194ec62
4
+ data.tar.gz: ec456a93a6e83999e083f7f2f0c4525d429516dc
5
5
  SHA512:
6
- metadata.gz: c17a94e9fae19d6a1c59ba46e0f86aca656934696652e19101ea354da8caaf21862aaa5ffcffffafe430dfbd7c3fa9581ed100e2ed2d85828c78ce0c7a5af2e3
7
- data.tar.gz: 1be229a2a98c6e24534a9bc5e3123737adb9792e0626a1f21d6572e158370c09ec1df4f7c21434393584a34ba1d2257c03abb048edb63bf5f03c8153d80ee3d9
6
+ metadata.gz: 3f1a7064f366f8bd02bb1399b913928f0f4644ad48a89412d87a0847deb7d76eed6690e6c20f88d31c53651a21bfe101331a136b66994ab0c6e5fb2a26166cf5
7
+ data.tar.gz: 96f64a7d81ade052b0ca70fc1c3cda652c9de42cebb20fef3b80094807c5c543c30b95b98b0aa5dc8d3481958fbd274476a8a71df91d86db6e95c72df8eb804b
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Change Log
4
4
 
5
+ ## 1.8.6
6
+
7
+ * Bug fix: Don't drop column `array: true` for ActiveRecord 4.2. (#199)
8
+
5
9
  ## 1.8.5
6
10
 
7
11
  * Bug fix: DB_DEFAULT shouldn't cause t.inet columns to fail. (#198)
@@ -4,3 +4,5 @@ gemspec :path => File.expand_path('..', __FILE__)
4
4
  platform :ruby do
5
5
  gem "byebug" if RUBY_VERSION > "2"
6
6
  end
7
+
8
+ File.exist?(gemfile_local = File.expand_path('../Gemfile.local', __FILE__)) and eval File.read(gemfile_local), binding, gemfile_local
@@ -31,14 +31,7 @@ module SchemaPlus
31
31
  end
32
32
  else
33
33
  def initialize(name, default, cast_type, sql_type = nil, null = true, default_function = nil)
34
- if sql_type =~ /\[\]$/
35
- @array = true
36
- super(name, default, cast_type, sql_type[0..sql_type.length - 3], null)
37
- else
38
- @array = false
39
- super(name, default, cast_type, sql_type, null)
40
- end
41
-
34
+ super(name, default, cast_type, sql_type, null)
42
35
  @default_function = @default_expr = default_function
43
36
  end
44
37
  end
@@ -1,3 +1,3 @@
1
1
  module SchemaPlus
2
- VERSION = "1.8.5"
2
+ VERSION = "1.8.6"
3
3
  end
@@ -138,6 +138,18 @@ describe "Column" do
138
138
  end
139
139
  end
140
140
 
141
+ context "Postgresql array", :postgresql => :only do
142
+
143
+ before(:each) do
144
+ create_table(User, :alpha => { :default => [], :array => true })
145
+ end
146
+
147
+ it "respects array: true" do
148
+ column = User.columns.find(&its.name == "alpha")
149
+ expect(column.array).to be_truthy
150
+ end
151
+ end if "#{::ActiveRecord::VERSION::MAJOR}.#{::ActiveRecord::VERSION::MINOR}".to_r >= "4.0".to_r
152
+
141
153
  protected
142
154
 
143
155
  def create_table(model, columns_with_options)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schema_plus
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.5
4
+ version: 1.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ronen Barzel
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-01-23 00:00:00.000000000 Z
12
+ date: 2015-01-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord