friendly_id 2.2.7 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog.md +225 -0
- data/Contributors.md +28 -0
- data/Guide.md +509 -0
- data/LICENSE +1 -1
- data/README.md +76 -0
- data/Rakefile +48 -15
- data/extras/bench.rb +59 -0
- data/extras/extras.rb +31 -0
- data/extras/prof.rb +14 -0
- data/extras/template-gem.rb +1 -1
- data/extras/template-plugin.rb +1 -1
- data/generators/friendly_id/friendly_id_generator.rb +1 -1
- data/generators/friendly_id/templates/create_slugs.rb +2 -2
- data/lib/friendly_id.rb +54 -63
- data/lib/friendly_id/active_record2.rb +47 -0
- data/lib/friendly_id/active_record2/configuration.rb +66 -0
- data/lib/friendly_id/active_record2/finders.rb +140 -0
- data/lib/friendly_id/active_record2/simple_model.rb +162 -0
- data/lib/friendly_id/active_record2/slug.rb +111 -0
- data/lib/friendly_id/active_record2/slugged_model.rb +317 -0
- data/lib/friendly_id/active_record2/tasks.rb +66 -0
- data/lib/friendly_id/active_record2/tasks/friendly_id.rake +19 -0
- data/lib/friendly_id/configuration.rb +132 -0
- data/lib/friendly_id/finders.rb +106 -0
- data/lib/friendly_id/slug_string.rb +292 -0
- data/lib/friendly_id/slugged.rb +91 -0
- data/lib/friendly_id/status.rb +35 -0
- data/lib/friendly_id/test.rb +168 -0
- data/lib/friendly_id/version.rb +5 -5
- data/rails/init.rb +2 -0
- data/test/active_record2/basic_slugged_model_test.rb +14 -0
- data/test/active_record2/cached_slug_test.rb +61 -0
- data/test/active_record2/core.rb +93 -0
- data/test/active_record2/custom_normalizer_test.rb +20 -0
- data/test/active_record2/custom_table_name_test.rb +22 -0
- data/test/active_record2/scoped_model_test.rb +111 -0
- data/test/active_record2/simple_test.rb +59 -0
- data/test/active_record2/slug_test.rb +34 -0
- data/test/active_record2/slugged.rb +30 -0
- data/test/active_record2/slugged_status_test.rb +61 -0
- data/test/active_record2/sti_test.rb +22 -0
- data/test/active_record2/support/database.mysql.yml +4 -0
- data/test/{support/database.yml.postgres → active_record2/support/database.postgres.yml} +0 -0
- data/test/{support/database.yml.sqlite3 → active_record2/support/database.sqlite3.yml} +0 -0
- data/test/{support → active_record2/support}/models.rb +28 -0
- data/test/active_record2/tasks_test.rb +82 -0
- data/test/active_record2/test_helper.rb +107 -0
- data/test/friendly_id_test.rb +23 -0
- data/test/slug_string_test.rb +74 -0
- data/test/test_helper.rb +7 -102
- metadata +64 -56
- data/History.txt +0 -194
- data/README.rdoc +0 -385
- data/generators/friendly_id_20_upgrade/friendly_id_20_upgrade_generator.rb +0 -12
- data/generators/friendly_id_20_upgrade/templates/upgrade_friendly_id_to_20.rb +0 -19
- data/init.rb +0 -1
- data/lib/friendly_id/helpers.rb +0 -12
- data/lib/friendly_id/non_sluggable_class_methods.rb +0 -34
- data/lib/friendly_id/non_sluggable_instance_methods.rb +0 -45
- data/lib/friendly_id/slug.rb +0 -98
- data/lib/friendly_id/sluggable_class_methods.rb +0 -110
- data/lib/friendly_id/sluggable_instance_methods.rb +0 -161
- data/lib/friendly_id/tasks.rb +0 -56
- data/lib/tasks/friendly_id.rake +0 -25
- data/lib/tasks/friendly_id.rb +0 -1
- data/test/cached_slug_test.rb +0 -109
- data/test/custom_slug_normalizer_test.rb +0 -36
- data/test/non_slugged_test.rb +0 -99
- data/test/scoped_model_test.rb +0 -64
- data/test/slug_test.rb +0 -105
- data/test/slugged_model_test.rb +0 -348
- data/test/sti_test.rb +0 -49
- data/test/tasks_test.rb +0 -105
@@ -0,0 +1,23 @@
|
|
1
|
+
require(File.dirname(__FILE__) + "/test_helper")
|
2
|
+
|
3
|
+
module FriendlyId
|
4
|
+
|
5
|
+
module Test
|
6
|
+
|
7
|
+
class FriendlyIdTest < ::Test::Unit::TestCase
|
8
|
+
|
9
|
+
test "should parse a friendly_id name and sequence" do
|
10
|
+
assert_equal ["test", "2"], "test--2".parse_friendly_id
|
11
|
+
end
|
12
|
+
|
13
|
+
test "should parse with a default sequence of 1" do
|
14
|
+
assert_equal ["test", "1"], "test".parse_friendly_id
|
15
|
+
end
|
16
|
+
|
17
|
+
test "should be parseable with a custom separator" do
|
18
|
+
assert_equal ["test", "2"], "test:2".parse_friendly_id(":")
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,74 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require(File.dirname(__FILE__) + "/test_helper")
|
3
|
+
|
4
|
+
module FriendlyId
|
5
|
+
module Test
|
6
|
+
|
7
|
+
class SlugStringTest < ::Test::Unit::TestCase
|
8
|
+
|
9
|
+
test "should approximate ascii" do
|
10
|
+
# create string with range of Unicode"s western characters with
|
11
|
+
# diacritics, excluding the division and multiplication signs which for
|
12
|
+
# some reason or other are floating in the middle of all the letters.
|
13
|
+
s = SlugString.new((0xC0..0x17E).to_a.reject {|c| [0xD7, 0xF7].include? c}.pack("U*"))
|
14
|
+
output = s.approximate_ascii
|
15
|
+
assert(output.length > s.length)
|
16
|
+
assert_match output, /^[a-zA-Z']*$/
|
17
|
+
end
|
18
|
+
|
19
|
+
test "should strip non-word chars" do
|
20
|
+
s = SlugString.new "¡feliz año!"
|
21
|
+
assert_equal "feliz año", s.word_chars
|
22
|
+
end
|
23
|
+
|
24
|
+
test "should lowercase strings" do
|
25
|
+
assert_equal "feliz año", SlugString.new("FELIZ AÑO").downcase
|
26
|
+
end
|
27
|
+
|
28
|
+
test "should uppercase strings" do
|
29
|
+
assert_equal "FELIZ AÑO", SlugString.new("feliz año").upcase
|
30
|
+
end
|
31
|
+
|
32
|
+
test "should replace whitespace with dashes" do
|
33
|
+
assert_equal "a-b", SlugString.new("a b").clean.with_dashes
|
34
|
+
end
|
35
|
+
|
36
|
+
test "should replace multiple spaces with 1 dash" do
|
37
|
+
assert_equal "a-b", SlugString.new("a b").clean.with_dashes
|
38
|
+
end
|
39
|
+
|
40
|
+
test "should strip trailing space" do
|
41
|
+
assert_equal "ab", SlugString.new("ab ").clean
|
42
|
+
end
|
43
|
+
|
44
|
+
test "should strip leading space" do
|
45
|
+
assert_equal "ab", SlugString.new(" ab").clean
|
46
|
+
end
|
47
|
+
|
48
|
+
test "should strip trailing slashes" do
|
49
|
+
assert_equal "ab", SlugString.new("ab-").clean
|
50
|
+
end
|
51
|
+
|
52
|
+
test "should strip leading slashes" do
|
53
|
+
assert_equal "ab", SlugString.new("-ab").clean
|
54
|
+
end
|
55
|
+
|
56
|
+
test "should not modify valid name strings" do
|
57
|
+
assert_equal "a-b-c-d", SlugString.new("a-b-c-d").clean
|
58
|
+
end
|
59
|
+
|
60
|
+
test "should do special approximations for German" do
|
61
|
+
assert_equal "Juergen", SlugString.new("Jürgen").approximate_ascii(:german)
|
62
|
+
end
|
63
|
+
|
64
|
+
test "should do special approximations for Spanish" do
|
65
|
+
assert_equal "anno", SlugString.new("año").approximate_ascii(:spanish)
|
66
|
+
end
|
67
|
+
|
68
|
+
test "should work with non roman chars" do
|
69
|
+
assert_equal "検-索", SlugString.new("検 索").with_dashes
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
data/test/test_helper.rb
CHANGED
@@ -1,104 +1,9 @@
|
|
1
|
-
|
2
|
-
$:.unshift(File.dirname(__FILE__))
|
3
|
-
|
4
|
-
$KCODE = 'UTF8' if RUBY_VERSION < '1.9'
|
1
|
+
$KCODE = "UTF8" if RUBY_VERSION < "1.9"
|
5
2
|
$VERBOSE = false
|
6
3
|
|
7
|
-
require
|
8
|
-
require
|
9
|
-
require
|
10
|
-
require
|
11
|
-
|
12
|
-
|
13
|
-
# The default is to use the latest installed ActiveRecord.
|
14
|
-
if ENV["AR_VERSION"]
|
15
|
-
gem 'activerecord', "#{ENV["AR_VERSION"]}"
|
16
|
-
gem 'activesupport', "#{ENV["AR_VERSION"]}"
|
17
|
-
end
|
18
|
-
|
19
|
-
require 'active_record'
|
20
|
-
require 'active_support'
|
21
|
-
require 'friendly_id'
|
22
|
-
require File.dirname(__FILE__) + '/../generators/friendly_id/templates/create_slugs'
|
23
|
-
require File.dirname(__FILE__) + '/support/models'
|
24
|
-
|
25
|
-
local_db_settings = File.dirname(__FILE__) + '/support/database.yml'
|
26
|
-
default_db_settings = File.dirname(__FILE__) + '/support/database.yml.sqlite3'
|
27
|
-
db_settings = File.exists?(local_db_settings) ? local_db_settings : default_db_settings
|
28
|
-
ActiveRecord::Base.establish_connection(YAML::load(File.open(db_settings)))
|
29
|
-
|
30
|
-
class ActiveRecord::Base
|
31
|
-
def log_protected_attribute_removal(*args) end
|
32
|
-
end
|
33
|
-
|
34
|
-
ActiveRecord::Base.connection.tables.each do |table|
|
35
|
-
ActiveRecord::Base.connection.drop_table(table)
|
36
|
-
end
|
37
|
-
ActiveRecord::Migration.verbose = false
|
38
|
-
CreateSlugs.up
|
39
|
-
CreateSupportModels.up
|
40
|
-
|
41
|
-
# A model that uses the automagically configured "cached_slug" column
|
42
|
-
class District < ActiveRecord::Base
|
43
|
-
has_friendly_id :name, :use_slug => true
|
44
|
-
end
|
45
|
-
|
46
|
-
# A model that specifies a custom cached slug column
|
47
|
-
class City < ActiveRecord::Base
|
48
|
-
attr_accessible :name
|
49
|
-
has_friendly_id :name, :use_slug => true, :cache_column => 'my_slug'
|
50
|
-
end
|
51
|
-
|
52
|
-
# A model with a custom slug text normalizer
|
53
|
-
class Person < ActiveRecord::Base
|
54
|
-
has_friendly_id :name, :use_slug => true do |text|
|
55
|
-
text.upcase
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
# A slugged model that uses a scope
|
60
|
-
class Resident < ActiveRecord::Base
|
61
|
-
belongs_to :country
|
62
|
-
has_friendly_id :name, :use_slug => true, :scope => :country
|
63
|
-
end
|
64
|
-
|
65
|
-
# A model used as a scope
|
66
|
-
class Country < ActiveRecord::Base
|
67
|
-
has_many :people
|
68
|
-
has_friendly_id :name, :use_slug => true
|
69
|
-
end
|
70
|
-
|
71
|
-
# A model that doesn't use slugs
|
72
|
-
class User < ActiveRecord::Base
|
73
|
-
has_friendly_id :name
|
74
|
-
end
|
75
|
-
|
76
|
-
# A model that uses default slug settings and has a named scope
|
77
|
-
class Post < ActiveRecord::Base
|
78
|
-
has_friendly_id :name, :use_slug => true
|
79
|
-
named_scope :published, :conditions => { :published => true }
|
80
|
-
end
|
81
|
-
|
82
|
-
# Model that uses a custom table name
|
83
|
-
class Place < ActiveRecord::Base
|
84
|
-
self.table_name = "legacy_table"
|
85
|
-
has_friendly_id :name, :use_slug => true
|
86
|
-
end
|
87
|
-
|
88
|
-
# A model that uses a datetime field for its friendly_id
|
89
|
-
class Event < ActiveRecord::Base
|
90
|
-
has_friendly_id :event_date, :use_slug => true
|
91
|
-
end
|
92
|
-
|
93
|
-
# A base model for single table inheritence
|
94
|
-
class Book < ActiveRecord::Base ; end
|
95
|
-
|
96
|
-
# A model that uses STI
|
97
|
-
class Novel < ::Book
|
98
|
-
has_friendly_id :name, :use_slug => true
|
99
|
-
end
|
100
|
-
|
101
|
-
# A model with no table
|
102
|
-
class Question < ActiveRecord::Base
|
103
|
-
has_friendly_id :name, :use_slug => true
|
104
|
-
end
|
4
|
+
require "rubygems"
|
5
|
+
require "test/unit"
|
6
|
+
require "mocha"
|
7
|
+
require "active_support"
|
8
|
+
require File.dirname(__FILE__) + "/../lib/friendly_id"
|
9
|
+
require File.dirname(__FILE__) + "/../lib/friendly_id/test"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: friendly_id
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Norman Clarke
|
@@ -11,7 +11,7 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date:
|
14
|
+
date: 2010-02-04 00:00:00 -03:00
|
15
15
|
default_executable:
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
@@ -22,7 +22,7 @@ dependencies:
|
|
22
22
|
requirements:
|
23
23
|
- - ">="
|
24
24
|
- !ruby/object:Gem::Version
|
25
|
-
version: 2.2
|
25
|
+
version: "2.2"
|
26
26
|
version:
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activesupport
|
@@ -32,19 +32,9 @@ dependencies:
|
|
32
32
|
requirements:
|
33
33
|
- - ">="
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: 2.2
|
35
|
+
version: "2.2"
|
36
36
|
version:
|
37
|
-
-
|
38
|
-
name: contest
|
39
|
-
type: :development
|
40
|
-
version_requirement:
|
41
|
-
version_requirements: !ruby/object:Gem::Requirement
|
42
|
-
requirements:
|
43
|
-
- - ">="
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: "0"
|
46
|
-
version:
|
47
|
-
description: " FriendlyId is the \"Swiss Army bulldozer\" of slugging and permalink\n plugins for Ruby on Rails. It allows you to create pretty URL\xE2\x80\x99s\n and work with human-friendly strings as if they were numeric ids for\n ActiveRecord models.\n"
|
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"
|
48
38
|
email:
|
49
39
|
- norman@njclarke.com
|
50
40
|
- adrian@mugnolo.com
|
@@ -53,47 +43,62 @@ executables: []
|
|
53
43
|
|
54
44
|
extensions: []
|
55
45
|
|
56
|
-
extra_rdoc_files:
|
57
|
-
|
58
|
-
- History.txt
|
46
|
+
extra_rdoc_files: []
|
47
|
+
|
59
48
|
files:
|
60
|
-
- lib/friendly_id/
|
61
|
-
- lib/friendly_id/
|
62
|
-
- lib/friendly_id/
|
63
|
-
- lib/friendly_id/slug.rb
|
64
|
-
- lib/friendly_id/
|
65
|
-
- lib/friendly_id/
|
66
|
-
- lib/friendly_id/
|
49
|
+
- lib/friendly_id/active_record2/configuration.rb
|
50
|
+
- lib/friendly_id/active_record2/finders.rb
|
51
|
+
- lib/friendly_id/active_record2/simple_model.rb
|
52
|
+
- lib/friendly_id/active_record2/slug.rb
|
53
|
+
- lib/friendly_id/active_record2/slugged_model.rb
|
54
|
+
- lib/friendly_id/active_record2/tasks.rb
|
55
|
+
- lib/friendly_id/active_record2.rb
|
56
|
+
- lib/friendly_id/configuration.rb
|
57
|
+
- lib/friendly_id/finders.rb
|
58
|
+
- lib/friendly_id/slug_string.rb
|
59
|
+
- lib/friendly_id/slugged.rb
|
60
|
+
- lib/friendly_id/status.rb
|
61
|
+
- lib/friendly_id/test.rb
|
67
62
|
- lib/friendly_id/version.rb
|
68
63
|
- lib/friendly_id.rb
|
69
|
-
- lib/tasks/friendly_id.
|
70
|
-
-
|
71
|
-
-
|
72
|
-
-
|
73
|
-
-
|
64
|
+
- lib/friendly_id/active_record2/tasks/friendly_id.rake
|
65
|
+
- Changelog.md
|
66
|
+
- Contributors.md
|
67
|
+
- Guide.md
|
68
|
+
- README.md
|
74
69
|
- LICENSE
|
75
70
|
- Rakefile
|
71
|
+
- rails/init.rb
|
76
72
|
- generators/friendly_id/friendly_id_generator.rb
|
77
73
|
- generators/friendly_id/templates/create_slugs.rb
|
78
|
-
-
|
79
|
-
-
|
80
|
-
- test/
|
81
|
-
- test/
|
82
|
-
- test/
|
83
|
-
- test/scoped_model_test.rb
|
84
|
-
- test/
|
85
|
-
- test/
|
86
|
-
- test/
|
87
|
-
- test/
|
88
|
-
- test/
|
89
|
-
- test/support/
|
90
|
-
- test/
|
74
|
+
- test/active_record2/basic_slugged_model_test.rb
|
75
|
+
- test/active_record2/cached_slug_test.rb
|
76
|
+
- test/active_record2/core.rb
|
77
|
+
- test/active_record2/custom_normalizer_test.rb
|
78
|
+
- test/active_record2/custom_table_name_test.rb
|
79
|
+
- test/active_record2/scoped_model_test.rb
|
80
|
+
- test/active_record2/simple_test.rb
|
81
|
+
- test/active_record2/slug_test.rb
|
82
|
+
- test/active_record2/slugged.rb
|
83
|
+
- test/active_record2/slugged_status_test.rb
|
84
|
+
- test/active_record2/sti_test.rb
|
85
|
+
- test/active_record2/support/database.mysql.yml
|
86
|
+
- test/active_record2/support/database.postgres.yml
|
87
|
+
- test/active_record2/support/database.sqlite3.yml
|
88
|
+
- test/active_record2/support/models.rb
|
89
|
+
- test/active_record2/tasks_test.rb
|
90
|
+
- test/active_record2/test_helper.rb
|
91
|
+
- test/friendly_id_test.rb
|
92
|
+
- test/slug_string_test.rb
|
91
93
|
- test/test_helper.rb
|
94
|
+
- extras/bench.rb
|
95
|
+
- extras/extras.rb
|
96
|
+
- extras/prof.rb
|
92
97
|
- extras/README.txt
|
93
98
|
- extras/template-gem.rb
|
94
99
|
- extras/template-plugin.rb
|
95
100
|
has_rdoc: true
|
96
|
-
homepage: http://
|
101
|
+
homepage: http://norman.github.com/friendly_id
|
97
102
|
licenses: []
|
98
103
|
|
99
104
|
post_install_message: |+
|
@@ -109,9 +114,8 @@ post_install_message: |+
|
|
109
114
|
|
110
115
|
***********************************************************
|
111
116
|
|
112
|
-
rdoc_options:
|
113
|
-
|
114
|
-
- README.rdoc
|
117
|
+
rdoc_options: []
|
118
|
+
|
115
119
|
require_paths:
|
116
120
|
- lib
|
117
121
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -132,13 +136,17 @@ rubyforge_project: friendly-id
|
|
132
136
|
rubygems_version: 1.3.5
|
133
137
|
signing_key:
|
134
138
|
specification_version: 3
|
135
|
-
summary: A comprehensive slugging and pretty-URL plugin
|
139
|
+
summary: A comprehensive slugging and pretty-URL plugin.
|
136
140
|
test_files:
|
137
|
-
- test/
|
138
|
-
- test/
|
139
|
-
- test/
|
140
|
-
- test/
|
141
|
-
- test/
|
142
|
-
- test/
|
143
|
-
- test/
|
144
|
-
- test/
|
141
|
+
- test/active_record2/basic_slugged_model_test.rb
|
142
|
+
- test/active_record2/cached_slug_test.rb
|
143
|
+
- test/active_record2/custom_normalizer_test.rb
|
144
|
+
- test/active_record2/custom_table_name_test.rb
|
145
|
+
- test/active_record2/scoped_model_test.rb
|
146
|
+
- test/active_record2/simple_test.rb
|
147
|
+
- test/active_record2/slug_test.rb
|
148
|
+
- test/active_record2/slugged_status_test.rb
|
149
|
+
- test/active_record2/sti_test.rb
|
150
|
+
- test/active_record2/tasks_test.rb
|
151
|
+
- test/friendly_id_test.rb
|
152
|
+
- test/slug_string_test.rb
|
data/History.txt
DELETED
@@ -1,194 +0,0 @@
|
|
1
|
-
== 2.2.7 2009-12-16
|
2
|
-
|
3
|
-
* 1 minor fix
|
4
|
-
* Fixed typo in Rake tasks which caused delete_old_slugs to fail. (Diego R.V.)
|
5
|
-
|
6
|
-
== 2.2.6 2009-12-10
|
7
|
-
|
8
|
-
* 2 major fixes
|
9
|
-
* Made cached_slug automagic configuration occur outside of has_friendly_id. This was causing problems
|
10
|
-
in code where the class is loaded before ActiveRecord has established its connection.
|
11
|
-
* Fixes for scope feature with Postgres (Ben Woosley)
|
12
|
-
|
13
|
-
* 2 minor enhancements
|
14
|
-
* Migrated away from Hoe/Newgem for gem management.
|
15
|
-
* Made tests database-agnostic (Ben Woosley)
|
16
|
-
|
17
|
-
== 2.2.5 2009-11-30
|
18
|
-
|
19
|
-
* 1 minor fix
|
20
|
-
* Fixed typo which in config options (Steven Noble).
|
21
|
-
|
22
|
-
== 2.2.4 2009-11-12
|
23
|
-
|
24
|
-
* 1 minor fix
|
25
|
-
* Fixed typo in post-install message.
|
26
|
-
|
27
|
-
== 2.2.3 2009-11-12
|
28
|
-
|
29
|
-
* 4 minor enhancements:
|
30
|
-
* Fixed some issues with gem load order under 1.8.x (closes GH Issue #20)
|
31
|
-
* Made sure friendly_id generator makes a lib/tasks directory (Josh Nichols)
|
32
|
-
* Finders now accept instances of ActiveRecord::Base, matching AR's behavior (Josh Nichols)
|
33
|
-
* SlugGenerationError now raise when a blank value is passed to strip_diacritics
|
34
|
-
|
35
|
-
== 2.2.2 2009-10-26
|
36
|
-
|
37
|
-
* 1 minor enhancement:
|
38
|
-
* Fixed Rake tasks creating duplicate slugs and not properly clearing cached slugs (closes GH issues #14 and #15)
|
39
|
-
|
40
|
-
== 2.2.1 2009-10-23
|
41
|
-
|
42
|
-
* 2 minor enhancements:
|
43
|
-
* slug cache now properly caches the slug sequence (closes GH issue #10)
|
44
|
-
* attr_protected is now only invoked on the cached_slug column if attr_accessible has not already been invoked. (closes GH issue #11)
|
45
|
-
|
46
|
-
== 2.2.0 2009-10-19
|
47
|
-
|
48
|
-
* 1 major enhancement:
|
49
|
-
* Added slug caching, offers huge performance boost (Bruno Michel)
|
50
|
-
|
51
|
-
* 2 minor enhancements:
|
52
|
-
* Handle Unicode string length correctly (Mikhail Shirkov)
|
53
|
-
* Remove alias_method_chain in favor of super (Diego Carrion)
|
54
|
-
|
55
|
-
== 2.1.4 2009-09-01
|
56
|
-
|
57
|
-
* 3 minor enhancements:
|
58
|
-
* Fixed upgrade generator not installing rake tasks (Harry Love)
|
59
|
-
* Fixed handling of very large id's (Nathan Phelps)
|
60
|
-
* Fixed long index name on migration (Rob Ingram)
|
61
|
-
|
62
|
-
== 2.1.3 2009-06-03
|
63
|
-
|
64
|
-
* 1 minor enhancement:
|
65
|
-
* Always call #to_s on slug_text to allow objects such as DateTimes to be used for the friendly_id text. (reported by Jon Ng)
|
66
|
-
|
67
|
-
== 2.1.2 2009-05-21
|
68
|
-
|
69
|
-
* 2 minor enhancements:
|
70
|
-
* Non-slugged models now validate the friendly_id on save as well as create (Joe Van Dyk).
|
71
|
-
* Replaced Shoulda with Contest.
|
72
|
-
|
73
|
-
== 2.1.1 2009-03-25
|
74
|
-
|
75
|
-
* 2 minor enhancements:
|
76
|
-
* Fixed bug with find_some; if a record has old slugs, find_some will no longer return
|
77
|
-
multiple copies of that record when finding by numerical ID. (Steve Luscher)
|
78
|
-
* Fixed bug with find_some: you can now find_some with an array of numerical IDs without
|
79
|
-
an error being thrown. (Steve Luscher)
|
80
|
-
|
81
|
-
== 2.1.0 2009-03-25
|
82
|
-
|
83
|
-
* 2 major enhancements:
|
84
|
-
* Ruby 1.9 compatibility.
|
85
|
-
* Removed dependency on ancient Unicode gem.
|
86
|
-
|
87
|
-
== 2.0.4 2009-02-12
|
88
|
-
|
89
|
-
* 1 major enhancment:
|
90
|
-
* You can now pass in your own custom slug generation blocks while setting up friendly_id.
|
91
|
-
|
92
|
-
== 2.0.3 2009-02-11
|
93
|
-
|
94
|
-
* 1 minor enhancment:
|
95
|
-
* Fixed to_param returning an empty string for non-slugged models with a null friendly_id.
|
96
|
-
|
97
|
-
== 2.0.2 2009-02-09
|
98
|
-
|
99
|
-
* 2 major enhancements:
|
100
|
-
* Made FriendlyId depend only on ActiveRecord. It should now be possible to
|
101
|
-
use FriendlyId with Camping or any other codebase that uses AR.
|
102
|
-
* Overhauled creaky testing setup and switched to Shoulda.
|
103
|
-
|
104
|
-
* 1 minor enhancment:
|
105
|
-
* Made reserved words work for non-slugged models.
|
106
|
-
|
107
|
-
== 2.0.1 2009-01-19
|
108
|
-
|
109
|
-
* 1 minor enhancements:
|
110
|
-
* Fix infinite redirect bug when using .has_better_id? in your controllers (Sean Abrahams)
|
111
|
-
|
112
|
-
|
113
|
-
== 2.0.0 2009-01-03
|
114
|
-
|
115
|
-
* 5 major enhancements:
|
116
|
-
* Support for scoped slugs (Norman Clarke)
|
117
|
-
* Support for UTF-8 friendly_ids (Norman Clarke)
|
118
|
-
* Can now be installed via Ruby Gems, or as a Rails plugin (Norman Clarke)
|
119
|
-
* Improved handling of non-unique slugs (Norman Clarke and Adrian Mugnolo)
|
120
|
-
* 2 minor enhancements:
|
121
|
-
* Shoulda macro (Josh Nichols)
|
122
|
-
* Various small bugfixes, cleanups and refactorings
|
123
|
-
|
124
|
-
== 2008-12-01
|
125
|
-
|
126
|
-
* Fixed bug that may return invalid records having similar id/names and using MySQL. (Emilio Tagua)
|
127
|
-
* Fixed slug generation to increment only numeric extension without modifying the name on duplicated slugs. (Emilio Tagua)
|
128
|
-
|
129
|
-
== 2008-10-31
|
130
|
-
|
131
|
-
* Fixed compatibility with Rails 2.0.x. (Norman Clarke)
|
132
|
-
* friendly_id::make_slugs update records in chunks of 1000 to avoid running out of memory with large datasets. (Tim Kadom)
|
133
|
-
* Fixed logic error with slug name collisions. Thanks to Tim Kadom for reporting this bug.
|
134
|
-
|
135
|
-
== 2008-10-22
|
136
|
-
|
137
|
-
* Reverted use of UTF8Handler - was causing errors for some people (Bence Nagy)
|
138
|
-
* Corrected find in case if a friendly_id begins with number (Bence Nagy)
|
139
|
-
* Added ability to reserve words from slugs (Adam Cigánek)
|
140
|
-
|
141
|
-
== 2008-10-09
|
142
|
-
|
143
|
-
* Moved "require"" for iconv to init.rb (Florian Aßmann)
|
144
|
-
* Removed "require" for Unicode, use Rails' handler instead (Florian Aßmann)
|
145
|
-
* Replaced some magic numbers with constants (Florian Aßmann)
|
146
|
-
* Don't overwrite find, alias_method_chain find_one and find_some instead (Florian Aßmann)
|
147
|
-
* Slugs behave more like ids now (Florian Aßmann)
|
148
|
-
* Can find by mixture of ids and slugs (Florian Aßmann)
|
149
|
-
* Reformatted code and comments (Florian Aßmann)
|
150
|
-
* Added support for Edge Rails' Inflector::parameterize (Norman Clarke)
|
151
|
-
|
152
|
-
== 2008-08-25
|
153
|
-
|
154
|
-
* Moved strip_diacritics into Slug for easier reuse/better organization.
|
155
|
-
* Put class methods inside class << self block. (Norman Clarke)
|
156
|
-
|
157
|
-
* Small change to allow friendly_id to work better with STI. (David Ramalho)
|
158
|
-
|
159
|
-
== 2008-07-14
|
160
|
-
|
161
|
-
* Improved slug generation for friendly id's with apostrophes. (Alistair Holt)
|
162
|
-
* Added support for namespaced models in Rakefile. (David Ramalho)
|
163
|
-
|
164
|
-
== 2008-06-23
|
165
|
-
|
166
|
-
* Cached most recent slug to improve performance (Emilio Tagua).
|
167
|
-
|
168
|
-
== 2008-06-10
|
169
|
-
|
170
|
-
* Added ability to find friendly_ids by array (Emilio Tagua)
|
171
|
-
|
172
|
-
== 2008-05-15
|
173
|
-
|
174
|
-
* Made friendly_id raise an error if slug method returns a blank value.
|
175
|
-
|
176
|
-
== 2008-05-12
|
177
|
-
|
178
|
-
* Added experimental Github gemspec.
|
179
|
-
|
180
|
-
== 2008-04-18
|
181
|
-
|
182
|
-
* Improved slug name collision avoidance.
|
183
|
-
|
184
|
-
== 2008-03-13
|
185
|
-
|
186
|
-
* Added :dependent => :destroy to slug relation, as suggested by Emilio Tagua.
|
187
|
-
* Fixed error when renaming a slugged item back to a previously used name.
|
188
|
-
* Incorporated documentation changes suggested by Jesse Crouch and Chris Nolan.
|
189
|
-
|
190
|
-
== 2008-02-07
|
191
|
-
|
192
|
-
* Applied patches from blog commenter "suntzu" to fix problem with model values were being overwritten.
|
193
|
-
* Applied patch from Dan Blue to make friendly_id no longer ignore options on ActiveRecordBase#find.
|
194
|
-
* Added call to options.assert_valid_keys in has_friendly_id. Thanks to W. Andrew Loe III for pointing out that this was missing.
|