hashid-rails 0.1.1 → 0.1.2

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: 7fda7fa77ee2f874aac09e9179433bee7bf05074
4
- data.tar.gz: f1af03c1ce84bef012d2d4dd32cb22768f92dda3
3
+ metadata.gz: 7b2ea9d51584971cbf828a309a551da690745fbd
4
+ data.tar.gz: 04f8a2f59a6fa30308b3103b7698153795b6b46c
5
5
  SHA512:
6
- metadata.gz: 3b3ac34d5b43004baa62688e70ff12b7efd6f32a757aa6eb3386539cf00d800d452895523981c0b6e89df0f6f73e2649dff7cc38b5f45b4e352b7b411eb7c8e6
7
- data.tar.gz: 12c194d33eaaaa264751a3c75b3aa35b9573a373000a8e54123f0230b57b6b1a4c402bfe1139d594632611bfc2eeb06b5883085060a7134b3f432d74124c764d
6
+ metadata.gz: ef4dfa2c27773687fa4bf0b27e65bc415201fe1f022fdd31631c96ab2d4cef9b8c3b16a5209f5c12d9953bc1a3cb75906083d6b0c32aa83b8a440758a0f72752
7
+ data.tar.gz: 1c0d95fee24c8ce7d1d67df9ae4bb0740e57101d0e402e3398bd4ca2aa7f120b745bba65b7d53f353c40505110bc1a3d916a79778027fd9b693295fd2e818603
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.2 (2015-04-12)
4
+
5
+ - Let `Model#find` work with integers passed in as strings.
6
+
3
7
  ## 0.1.1 (2015-04-12)
4
8
 
5
9
  - Let `Model#find` work with integer model ids as well as hashids.
data/lib/hashid/rails.rb CHANGED
@@ -27,15 +27,11 @@ module Hashid
27
27
  end
28
28
 
29
29
  def decode_id(id)
30
- hashids.decode(id).first
30
+ hashids.decode(id.to_s).first
31
31
  end
32
32
 
33
33
  def find(hashid)
34
- if hashid.is_a? String
35
- super decode_id(hashid)
36
- else
37
- super hashid
38
- end
34
+ super decode_id(hashid) || hashid
39
35
  end
40
36
  end
41
37
  end
@@ -1,5 +1,5 @@
1
1
  module Hashid
2
2
  module Rails
3
- VERSION = '0.1.1'
3
+ VERSION = '0.1.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hashid-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Cypret