friendly_id 3.1.7.pre → 3.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Changelog.md +1 -1
- data/Guide.md +8 -0
- data/Rakefile +1 -0
- data/lib/friendly_id/version.rb +1 -1
- data/test/active_record_adapter/scoped_model_test.rb +4 -1
- metadata +12 -17
data/Changelog.md
CHANGED
@@ -6,7 +6,7 @@ suggestions, ideas and improvements to FriendlyId.
|
|
6
6
|
* Table of Contents
|
7
7
|
{:toc}
|
8
8
|
|
9
|
-
## 3.1.7 (
|
9
|
+
## 3.1.7 (2010-09-22)
|
10
10
|
|
11
11
|
* Reserved words can now be regular expressions.
|
12
12
|
* Fix broken SQL when finding with a nil scope on AR3 (Tony Primerano)
|
data/Guide.md
CHANGED
@@ -517,6 +517,14 @@ slugs older than 45 days.
|
|
517
517
|
|
518
518
|
# Misc tips
|
519
519
|
|
520
|
+
## Allowing Users to Override/Control Slugs
|
521
|
+
|
522
|
+
Would you like to mostly use default slugs, but allow the option of a
|
523
|
+
custom user-chosen slug in your application? If so, then you're not the first to
|
524
|
+
want this. Here's a [demo
|
525
|
+
application](http://github.com/norman/friendly_id_manual_slug_demo) showing how
|
526
|
+
it can be done.
|
527
|
+
|
520
528
|
## Default Scopes
|
521
529
|
|
522
530
|
Whether you're using FriendlyId or not, a good rule of thumb for default scopes
|
data/Rakefile
CHANGED
@@ -41,6 +41,7 @@ namespace :test do
|
|
41
41
|
Rake::TestTask.new(:friendly_id) { |t| t.pattern = "test/*_test.rb" }
|
42
42
|
Rake::TestTask.new(:ar) { |t| t.pattern = "test/active_record_adapter/*_test.rb" }
|
43
43
|
|
44
|
+
desc "Test against lots of versions"
|
44
45
|
task :pre_release do
|
45
46
|
["ree-1.8.7-2010.02", "ruby-1.9.2-p0"].each do |ruby|
|
46
47
|
["sqlite3", "mysql", "postgres"].each do |driver|
|
data/lib/friendly_id/version.rb
CHANGED
@@ -12,6 +12,7 @@ module FriendlyId
|
|
12
12
|
@canada = Country.create!(:name => "Canada")
|
13
13
|
@resident = Resident.create!(:name => "John Smith", :country => @usa)
|
14
14
|
@resident2 = Resident.create!(:name => "John Smith", :country => @canada)
|
15
|
+
@resident3 = Resident.create!(:name => "Jim Beam", :country => @canada)
|
15
16
|
@owner = Company.create!(:name => "Acme Events")
|
16
17
|
@site = Site.create!(:name => "Downtown Venue", :owner => @owner)
|
17
18
|
end
|
@@ -75,7 +76,9 @@ module FriendlyId
|
|
75
76
|
end
|
76
77
|
|
77
78
|
test "should find all scoped records without scope" do
|
78
|
-
|
79
|
+
name, sequence = @resident.friendly_id.parse_friendly_id
|
80
|
+
assert_equal 2, Resident.find(:all, :joins => :slugs, :conditions => {
|
81
|
+
:slugs => {:name => name, :sequence => sequence}}).size
|
79
82
|
end
|
80
83
|
|
81
84
|
test "should find a single scoped record with a scope as a string" do
|
metadata
CHANGED
@@ -1,14 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: friendly_id
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease: true
|
4
|
+
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 3
|
8
7
|
- 1
|
9
8
|
- 7
|
10
|
-
|
11
|
-
version: 3.1.7.pre
|
9
|
+
version: 3.1.7
|
12
10
|
platform: ruby
|
13
11
|
authors:
|
14
12
|
- Norman Clarke
|
@@ -18,25 +16,24 @@ autorequire:
|
|
18
16
|
bindir: bin
|
19
17
|
cert_chain: []
|
20
18
|
|
21
|
-
date: 2010-09-
|
19
|
+
date: 2010-09-22 00:00:00 -03:00
|
22
20
|
default_executable:
|
23
21
|
dependencies:
|
24
22
|
- !ruby/object:Gem::Dependency
|
25
|
-
prerelease: false
|
26
|
-
type: :runtime
|
27
23
|
name: babosa
|
28
|
-
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
29
25
|
none: false
|
30
26
|
requirements:
|
31
27
|
- - ~>
|
32
28
|
- !ruby/object:Gem::Version
|
33
|
-
hash: 23
|
34
29
|
segments:
|
35
30
|
- 0
|
36
31
|
- 2
|
37
32
|
- 0
|
38
33
|
version: 0.2.0
|
39
|
-
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: *id001
|
40
37
|
description: " FriendlyId is the \"Swiss Army bulldozer\" of slugging and permalink plugins\n for Ruby on Rails. It allows you to create pretty URL\xE2\x80\x99s and work with\n human-friendly strings as if they were numeric ids for ActiveRecord models.\n"
|
41
38
|
email:
|
42
39
|
- norman@njclarke.com
|
@@ -120,21 +117,19 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
120
117
|
requirements:
|
121
118
|
- - ">="
|
122
119
|
- !ruby/object:Gem::Version
|
123
|
-
hash:
|
120
|
+
hash: -1691512069096853799
|
124
121
|
segments:
|
125
122
|
- 0
|
126
123
|
version: "0"
|
127
124
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
128
125
|
none: false
|
129
126
|
requirements:
|
130
|
-
- - "
|
127
|
+
- - ">="
|
131
128
|
- !ruby/object:Gem::Version
|
132
|
-
hash:
|
129
|
+
hash: -1691512069096853799
|
133
130
|
segments:
|
134
|
-
-
|
135
|
-
|
136
|
-
- 1
|
137
|
-
version: 1.3.1
|
131
|
+
- 0
|
132
|
+
version: "0"
|
138
133
|
requirements: []
|
139
134
|
|
140
135
|
rubyforge_project: friendly-id
|