incline 0.2.10 → 0.2.11

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: 9174d889051ac2895d238d66c60c41bc1e91e4a5
4
- data.tar.gz: 5b0d131ab6c8adc797dd640e6b9368da56399fec
3
+ metadata.gz: 5b62ef18063f4f8e5d9cd50a5212c011f4025ac8
4
+ data.tar.gz: faa2c8e63f99e0866c11d6f5d9543c25b660e8db
5
5
  SHA512:
6
- metadata.gz: d316df29b9d50711041c41f076f4acfd08cd98a7056c328bdf578ec621d644fd718c720b8f36653b92b1793f149ef08cbd19b18abaab079547d33d0b086c845e
7
- data.tar.gz: 40813983e2c87e5417dd65d5d927dacd6aad4b95a8c6a904876ce06c2a2e4f5d2ea973caf7f9a8d383288d21a414d55c099bea06681eb25a5f6fc88fb247fe03
6
+ metadata.gz: 21a76f806e068b464f719accea58c8a5696b27d0a2ea4f046bb42859f7e0cc65974bdd7c67b814cd44fa7993328e05760171df0e4b1900f49fe598de452cccfa
7
+ data.tar.gz: 49e8511afada33dc58eb6b4c7d787b6e2f86bb3abbab9314bd4c34cec6d681a68403649b517349f65d728e420ef9dea16c497f186de94a448c4af2a595cba4be
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- incline (0.2.10)
4
+ incline (0.2.11)
5
5
  ansi (~> 1.5.0)
6
6
  bcrypt
7
7
  bootstrap-sass
@@ -203,14 +203,21 @@ module Incline
203
203
  ##
204
204
  # Find the record represented by #locate_id.
205
205
  def find_record(relation = nil)
206
- return -1 if locate_id == 0
206
+ if locate_id.nil? || (locate_id.is_a?(::Numeric) && locate_id == 0) || (locate_id.to_s == '')
207
+ return -1
208
+ end
207
209
 
208
210
  dataset = load_records(relation, false)
209
211
  return -1 if dataset.blank?
210
212
 
211
213
  return -1 unless dataset.first.respond_to?(:id)
212
-
213
- dataset.index{|item| item.id == locate_id} || -1
214
+ if locate_id.is_a?(::Numeric)
215
+ dataset.index{|item| item.id == locate_id} || -1
216
+ else
217
+ loc_id = locate_id.to_s.downcase
218
+ dataset.index{|item| item.id.to_s.downcase == loc_id} || -1
219
+ end
220
+
214
221
  end
215
222
 
216
223
  ##
@@ -1,3 +1,3 @@
1
1
  module Incline
2
- VERSION = "0.2.10"
2
+ VERSION = "0.2.11"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: incline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.10
4
+ version: 0.2.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Beau Barker
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-15 00:00:00.000000000 Z
11
+ date: 2017-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -604,7 +604,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
604
604
  version: '0'
605
605
  requirements: []
606
606
  rubyforge_project:
607
- rubygems_version: 2.6.11
607
+ rubygems_version: 2.5.2
608
608
  signing_key:
609
609
  specification_version: 4
610
610
  summary: A gem designed to get off to an even quicker start with Rails.