find_by_param 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/find_by_param.rb +10 -3
- data/lib/find_by_param/version.rb +1 -1
- metadata +15 -15
data/lib/find_by_param.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
begin
|
2
|
+
$KCODE = 'u' if RUBY_VERSION < '1.9'
|
3
|
+
|
2
4
|
require 'rubygems'
|
3
5
|
require 'active_support'
|
4
6
|
rescue LoadError
|
@@ -11,7 +13,12 @@ module Railslove
|
|
11
13
|
return if ActiveRecord::Base.kind_of?(self::ClassMethods)
|
12
14
|
|
13
15
|
ActiveRecord::Base.class_eval do
|
14
|
-
|
16
|
+
if respond_to? :class_attribute
|
17
|
+
class_attribute :permalink_options
|
18
|
+
else
|
19
|
+
class_inheritable_accessor :permalink_options
|
20
|
+
end
|
21
|
+
|
15
22
|
self.permalink_options = {:param => :id}
|
16
23
|
|
17
24
|
#default finders these are overwritten if you use make_permalink in
|
@@ -168,8 +175,8 @@ finder.
|
|
168
175
|
|
169
176
|
def validate_param_is_not_blank
|
170
177
|
if self.escape_and_truncate_permalink(self.send(permalink_options[:with])).blank?
|
171
|
-
errors.add(permalink_options[:with],
|
172
|
-
"must have at least one non special character (a-z 0-9)")
|
178
|
+
errors.add(permalink_options[:with],
|
179
|
+
"must have at least one non special character (a-z 0-9)")
|
173
180
|
end
|
174
181
|
end
|
175
182
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: find_by_param
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,33 +10,33 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2011-09-
|
13
|
+
date: 2011-09-20 00:00:00.000000000Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activerecord
|
17
|
-
requirement: &
|
17
|
+
requirement: &2153357360 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
|
-
- -
|
20
|
+
- - ! '>='
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
22
|
+
version: '0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *2153357360
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: activesupport
|
28
|
-
requirement: &
|
28
|
+
requirement: &2153346060 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ! '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *2153346060
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: sqlite3-ruby
|
39
|
-
requirement: &
|
39
|
+
requirement: &2153340680 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ! '>='
|
@@ -44,10 +44,10 @@ dependencies:
|
|
44
44
|
version: '0'
|
45
45
|
type: :development
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *2153340680
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: rake
|
50
|
-
requirement: &
|
50
|
+
requirement: &2153339220 !ruby/object:Gem::Requirement
|
51
51
|
none: false
|
52
52
|
requirements:
|
53
53
|
- - ! '>='
|
@@ -55,7 +55,7 @@ dependencies:
|
|
55
55
|
version: '0'
|
56
56
|
type: :development
|
57
57
|
prerelease: false
|
58
|
-
version_requirements: *
|
58
|
+
version_requirements: *2153339220
|
59
59
|
description: find_by_param is a nice and easy way to handle permalinks and dealing
|
60
60
|
with searching for to_param values
|
61
61
|
email: michael@railslove.com
|
@@ -85,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
85
|
version: '0'
|
86
86
|
requirements: []
|
87
87
|
rubyforge_project: ! '[none]'
|
88
|
-
rubygems_version: 1.8.
|
88
|
+
rubygems_version: 1.8.10
|
89
89
|
signing_key:
|
90
90
|
specification_version: 3
|
91
91
|
summary: Rails plugin to handle permalink values
|