effective_slugs 1.1.0 → 1.1.1

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: ca6f1bdd031ce20260513fdf6929663c8cbdedcf
4
- data.tar.gz: cc5d68efab2b88fd6eabc3152a82b67da3398d3f
3
+ metadata.gz: 077a75e80b6da2c96419f222b12cbd1a8222e497
4
+ data.tar.gz: 6ee8fb4f6fdfbfd1267da9f642e4527bc0a8f0f5
5
5
  SHA512:
6
- metadata.gz: b07e70814443dfc738592c659db45f70f94d34e8d4b9a40daab2af59b34550ee02217f6e631fb2f817d6f5124e2d7bb2103b57e1fbdec43829ed3c17cc165d9d
7
- data.tar.gz: d79e02248e6300db36d7b9807c21e714a835fd8543588d93694c4957445646dd4afb75fd82fa4c5203e0b2b4628b79071dda53f1b20485b891dfb0680fc1565d
6
+ metadata.gz: 80367506d043988d5cdae12f85c29f2a2188f9a1829143481c18d01f49874e1e674d939420575943dbba5cc0b48f2ccb7bb7ee5c61d4ba1a65997ba2cd7c491d
7
+ data.tar.gz: c7beee73d3b0be731af61aa4a81e40dd97be9ea84e86c6827087502647704a1782cc3f7890e9688aeebb204e55e25c10f0c5cac99ed01628b19a8a95b0a7ec46
@@ -111,11 +111,17 @@ module ActsAsSluggable
111
111
 
112
112
  module FinderMethods
113
113
  def find(*args)
114
- args.first.to_i > 0 ? super : find_by_slug(args)
114
+ regular_find?(args) ? super : find_by_slug(args)
115
115
  end
116
116
 
117
117
  def exists?(*args)
118
- args.first.to_i > 0 ? super : (find_by_slug(args).present? rescue false)
118
+ regular_find?(args) ? super : (find_by_slug(args).present? rescue false)
119
+ end
120
+
121
+ private
122
+
123
+ def regular_find?(args)
124
+ args.first.is_a?(Array) || args.first.to_i > 0
119
125
  end
120
126
  end
121
127
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveSlugs
2
- VERSION = '1.1.0'.freeze
2
+ VERSION = '1.1.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_slugs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-18 00:00:00.000000000 Z
11
+ date: 2015-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -75,7 +75,8 @@ files:
75
75
  - spec/spec_helper.rb
76
76
  - spec/support/factories.rb
77
77
  homepage: https://github.com/code-and-effect/effective_slugs
78
- licenses: []
78
+ licenses:
79
+ - MIT
79
80
  metadata: {}
80
81
  post_install_message:
81
82
  rdoc_options: []