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 +4 -4
- data/app/models/concerns/acts_as_sluggable.rb +8 -2
- data/lib/effective_slugs/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 077a75e80b6da2c96419f222b12cbd1a8222e497
|
4
|
+
data.tar.gz: 6ee8fb4f6fdfbfd1267da9f642e4527bc0a8f0f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
114
|
+
regular_find?(args) ? super : find_by_slug(args)
|
115
115
|
end
|
116
116
|
|
117
117
|
def exists?(*args)
|
118
|
-
args
|
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
|
|
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.
|
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:
|
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: []
|