validates_overlap 0.8.1 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1772233fdb3f2ca60d51a043c16c4ba7262315f0
|
4
|
+
data.tar.gz: 0de150f4239778eeec8ee3d8e282dc5e1dcc255a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e973e5fe6f7136bea964215b8ce8cef173fa143febf8ba782ba85a6e47c50d23517e4acb076bc1e1a1d3161b2a7c1fb62f752d610f2bba62c5d6295910409a84
|
7
|
+
data.tar.gz: 2e4b0ae239225a3128c0855db6da2f87619e19d96d0b1df28c741d04333ef83bef1111adca6d8efec05642f5698f43d3a3c808699fc85d7fd225913ac0bcbfe5
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.8.
|
1
|
+
0.8.2
|
@@ -187,7 +187,7 @@ class OverlapValidator < ActiveModel::EachValidator
|
|
187
187
|
end
|
188
188
|
|
189
189
|
def implement_enum?
|
190
|
-
(ActiveRecord::VERSION::MAJOR
|
190
|
+
(ActiveRecord::VERSION::MAJOR >= 5) || (ActiveRecord::VERSION::MAJOR > 4 && ActiveRecord::VERSION::MINOR > 1)
|
191
191
|
end
|
192
192
|
|
193
193
|
# Allow to use scope, joins, includes methods before querying
|
@@ -3,7 +3,7 @@ class DocumentWithEnum < ActiveRecord::Base
|
|
3
3
|
KINDS = [:contract, :fact, :draft]
|
4
4
|
|
5
5
|
|
6
|
-
if (ActiveRecord::VERSION::MAJOR
|
6
|
+
if (ActiveRecord::VERSION::MAJOR >= 5) || (ActiveRecord::VERSION::MAJOR > 4 && ActiveRecord::VERSION::MINOR > 1)
|
7
7
|
enum kind: KINDS
|
8
8
|
else
|
9
9
|
# Simulate enum functionality implemented in rails 4.1 and 5
|
@@ -47,7 +47,7 @@ describe DocumentWithEnum do
|
|
47
47
|
it 'save and read attribute properly' do
|
48
48
|
docuemnt = FactoryGirl.create(:document_with_enum, kind: :contract)
|
49
49
|
docuemnt.reload
|
50
|
-
expect(docuemnt.kind).to eq
|
50
|
+
expect(docuemnt.kind.to_s).to eq "contract"
|
51
51
|
end
|
52
52
|
end
|
53
53
|
end
|