apique 1.1.4 → 1.1.5
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 +4 -4
- data/lib/apique/filterable.rb +16 -6
- data/lib/apique/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4fb201ba3e1237c4c5779dfe00ae621ffd80a8e
|
4
|
+
data.tar.gz: fa83c66d37985ca2320896c9580e475b5da114af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27c95836792aedd0513525c83f36388482914a48228b6b94b58083354916c96e7c55dec8b7e4ec66f3792a650f8b2325e85018d10a6c3ce44973e2ab46adab00
|
7
|
+
data.tar.gz: 3c0a09ecabdf43d6e51734fa1692eda2936bb5e70ad60d571fddf721873451ee53cedfe8fec08afb0fda6a6538747c4fa318834eacbced4ee7ae57e8d6d52ac7
|
data/lib/apique/filterable.rb
CHANGED
@@ -127,17 +127,27 @@ module Apique::Filterable
|
|
127
127
|
end
|
128
128
|
end
|
129
129
|
|
130
|
+
if ActiveRecord::VERSION::MAJOR >= 5 and ActiveRecord::VERSION::MINOR >= 1
|
131
|
+
def text_type_class?(type_class)
|
132
|
+
type_class <= ActiveModel::Type::String
|
133
|
+
end
|
134
|
+
else
|
135
|
+
def text_type_class?(type_class)
|
136
|
+
[ActiveModel::Type::String, ActiveModel::Type::Text].find {|k| type_class <= k}
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
130
140
|
def get_cast_type(field)
|
131
|
-
|
132
|
-
if
|
141
|
+
type_class = get_cast_type_class(field)
|
142
|
+
if text_type_class?(type_class)
|
133
143
|
:text
|
134
|
-
elsif
|
144
|
+
elsif type_class <= ActiveModel::Type::Integer
|
135
145
|
:integer
|
136
|
-
elsif
|
146
|
+
elsif type_class <= ActiveModel::Type::Boolean
|
137
147
|
:boolean
|
138
|
-
elsif
|
148
|
+
elsif type_class <= ActiveModel::Type::DateTime
|
139
149
|
:datetime
|
140
|
-
elsif
|
150
|
+
elsif type_class <= ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Uuid
|
141
151
|
:uuid
|
142
152
|
end
|
143
153
|
end
|
data/lib/apique/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apique
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergey Baev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -126,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
126
126
|
version: '0'
|
127
127
|
requirements: []
|
128
128
|
rubyforge_project:
|
129
|
-
rubygems_version: 2.
|
129
|
+
rubygems_version: 2.4.8
|
130
130
|
signing_key:
|
131
131
|
specification_version: 4
|
132
132
|
summary: Rails CRUD API replacement
|