active_model-errors_details 1.1.1 → 1.2.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
  SHA1:
3
- metadata.gz: d4d6632e4dd7242b277bf363b81726d5e002ccd0
4
- data.tar.gz: 02bf7b30d95cf443b4fe0ee78014e14b2ab9bd4d
3
+ metadata.gz: 26eafe0432507692d145a348879901aa097de958
4
+ data.tar.gz: a9a9b46faa6d0529ebfee0aa712c06ddfbecae1f
5
5
  SHA512:
6
- metadata.gz: 5ed3fbe73cdb77c4e9aef296194741fe7e386c6ec1c16886e8992256c85ba19fad84504317965e65590f7d24135040b120db8d405d6cccb8757d218a9d3ec0aa
7
- data.tar.gz: c2fab31c23441276a98e4d4f2cc4debb5fd0618211cd2faf9fb49d1448a45ae706f80aca3883a7856fd2675638d4f3e31c156f52a5921ae84b2472e023f26312
6
+ metadata.gz: c6859c5e55f5637f6536c32f1ee8fc1367beb4940e6761a49e2398975c01578084de3b71bc0b62a499eedaa97613d2cf34c217f7f5e278de07a85d1ff7bf8177
7
+ data.tar.gz: 6ed6433f0a29093f243db25f1e8325fe3eead369121c968f158050136e4dc472fa0f9caf274113ce7401afed43e216a554afc1ccc3e14f2b42366aedd47b9bf2
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![Build Status](https://travis-ci.org/cowbell/active_model-errors_details.svg?branch=master)](https://travis-ci.org/cowbell/active_model-errors_details)
4
4
 
5
- Feature backported from Rails 5.0 to use with Rails 4.x apps.
5
+ Feature backported from Rails 5.0 to use with Rails 3.2.x and 4.x apps.
6
6
 
7
7
  Background: https://github.com/rails/rails/pull/18322
8
8
 
@@ -18,9 +18,10 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency "activemodel", ">= 4.0", "< 5.0.0.alpha"
21
+ spec.add_dependency "activemodel", ">= 3.2.13", "< 5.0.0.alpha"
22
22
  spec.add_dependency "activesupport"
23
23
 
24
24
  spec.add_development_dependency "bundler", "~> 1.7"
25
+ spec.add_development_dependency "minitest", "~> 5.6"
25
26
  spec.add_development_dependency "rake", "~> 10.0"
26
27
  end
@@ -1,6 +1,32 @@
1
1
  require "active_model/errors_details/version"
2
2
  require "active_model/errors"
3
- require "active_support/core_ext/object/deep_dup"
3
+
4
+ begin
5
+ require "active_support/core_ext/object/deep_dup"
6
+ rescue LoadError
7
+ # Rails 3.2 compatibility
8
+ require "active_support/core_ext/object/duplicable"
9
+
10
+ class Object
11
+ def deep_dup
12
+ duplicable? ? dup : self
13
+ end
14
+ end
15
+
16
+ class Array
17
+ def deep_dup
18
+ map(&:deep_dup)
19
+ end
20
+ end
21
+
22
+ class Hash
23
+ def deep_dup
24
+ each_with_object(dup) do |(key, value), hash|
25
+ hash[key.deep_dup] = value.deep_dup
26
+ end
27
+ end
28
+ end
29
+ end
4
30
 
5
31
  module ActiveModel
6
32
  module ErrorsDetails
@@ -1,5 +1,5 @@
1
1
  module ActiveModel
2
2
  module ErrorsDetails
3
- VERSION = "1.1.1"
3
+ VERSION = "1.2.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_model-errors_details
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wojciech Wnętrzak
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-05 00:00:00.000000000 Z
11
+ date: 2015-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '4.0'
19
+ version: 3.2.13
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 5.0.0.alpha
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '4.0'
29
+ version: 3.2.13
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 5.0.0.alpha
@@ -58,6 +58,20 @@ dependencies:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
60
  version: '1.7'
61
+ - !ruby/object:Gem::Dependency
62
+ name: minitest
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '5.6'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '5.6'
61
75
  - !ruby/object:Gem::Dependency
62
76
  name: rake
63
77
  requirement: !ruby/object:Gem::Requirement
@@ -110,11 +124,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
124
  version: '0'
111
125
  requirements: []
112
126
  rubyforge_project:
113
- rubygems_version: 2.4.6
127
+ rubygems_version: 2.4.5
114
128
  signing_key:
115
129
  specification_version: 4
116
130
  summary: Adds ActiveModel::Errors#details to return type of used validator
117
131
  test_files:
118
132
  - test/minitest_helper.rb
119
133
  - test/test_errors_details.rb
120
- has_rdoc: