apique 1.1.4 → 1.1.5

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: 2abc44aee04063bac64d15d2fded5de9af1f76cf
4
- data.tar.gz: 7052d6f9a055809dcb3552191a548d3fb60a8b2d
3
+ metadata.gz: b4fb201ba3e1237c4c5779dfe00ae621ffd80a8e
4
+ data.tar.gz: fa83c66d37985ca2320896c9580e475b5da114af
5
5
  SHA512:
6
- metadata.gz: 5129c3710bc99de5fc2e01cee6b38fbf01b3ddcec925f1ed0d1e406c57f0a0bfff316805caa2a8deb92bfbf2ebb1e4c5739b62c4adddbe965244555022e91f4d
7
- data.tar.gz: 48fc61433beb3a60d23a28604d2ff554fd8b45dfc0c6a275ba047ca64773b39218e4381af5a690960d6bdae6ec50eee4357ce51a99dadb9899747ee3fe8f3b02
6
+ metadata.gz: 27c95836792aedd0513525c83f36388482914a48228b6b94b58083354916c96e7c55dec8b7e4ec66f3792a650f8b2325e85018d10a6c3ce44973e2ab46adab00
7
+ data.tar.gz: 3c0a09ecabdf43d6e51734fa1692eda2936bb5e70ad60d571fddf721873451ee53cedfe8fec08afb0fda6a6538747c4fa318834eacbced4ee7ae57e8d6d52ac7
@@ -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
- type = get_cast_type_class(field)
132
- if [ActiveModel::Type::String, ActiveModel::Type::Text].find {|k| type <= k}
141
+ type_class = get_cast_type_class(field)
142
+ if text_type_class?(type_class)
133
143
  :text
134
- elsif type <= ActiveModel::Type::Integer
144
+ elsif type_class <= ActiveModel::Type::Integer
135
145
  :integer
136
- elsif type <= ActiveModel::Type::Boolean
146
+ elsif type_class <= ActiveModel::Type::Boolean
137
147
  :boolean
138
- elsif type <= ActiveModel::Type::DateTime
148
+ elsif type_class <= ActiveModel::Type::DateTime
139
149
  :datetime
140
- elsif type <= ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Uuid
150
+ elsif type_class <= ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Uuid
141
151
  :uuid
142
152
  end
143
153
  end
@@ -1,3 +1,3 @@
1
1
  module Apique
2
- VERSION = "1.1.4"
2
+ VERSION = "1.1.5"
3
3
  end
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
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-06-21 00:00:00.000000000 Z
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.5.1
129
+ rubygems_version: 2.4.8
130
130
  signing_key:
131
131
  specification_version: 4
132
132
  summary: Rails CRUD API replacement