friendly_id 3.0.5 → 3.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,6 +6,10 @@ suggestions, ideas and improvements to FriendlyId.
6
6
  * Table of Contents
7
7
  {:toc}
8
8
 
9
+ ## 3.0.6 (2010-06-10)
10
+
11
+ * Fix bad call to apply_mapping on 2.3.
12
+
9
13
  ## 3.0.5 (2010-06-10)
10
14
 
11
15
  * Fixed support for Rails 3.0 beta4 (Bruno Michel)
@@ -206,7 +206,13 @@ module FriendlyId
206
206
  # though your milage may vary with Greek and Turkic strings.
207
207
  # @return String
208
208
  def downcase!
209
- @wrapped_string = ActiveSupport::Multibyte::Unicode.apply_mapping(@wrapped_string, :lowercase_mapping)
209
+ @wrapped_string = apply_mapping :lowercase_mapping
210
+ end
211
+
212
+ if defined? ActiveSupport::Multibyte::Unicode
213
+ def apply_mapping(*args)
214
+ ActiveSupport::Multibyte::Unicode.apply_mapping(@wrapped_string, *args)
215
+ end
210
216
  end
211
217
 
212
218
  # Remove any non-word characters.
@@ -333,7 +339,7 @@ module FriendlyId
333
339
  # though your milage may vary with Greek and Turkic strings.
334
340
  # @return String
335
341
  def upcase!
336
- @wrapped_string = ActiveSupport::Multibyte::Unicode.apply_mapping(@wrapped_string, :uppercase_mapping)
342
+ @wrapped_string = apply_mapping :uppercase_mapping
337
343
  end
338
344
 
339
345
  # Validate that the slug string is not blank or reserved, and truncate
@@ -2,7 +2,7 @@ module FriendlyId
2
2
  module Version
3
3
  MAJOR = 3
4
4
  MINOR = 0
5
- TINY = 5
5
+ TINY = 6
6
6
  BUILD = nil
7
7
  STRING = [MAJOR, MINOR, TINY, BUILD].compact.join('.')
8
8
  end
@@ -38,7 +38,7 @@ end
38
38
  class Region < ActiveRecord::Base
39
39
  has_friendly_id :name, :use_slug => true
40
40
  after_create do |obj|
41
- other_instance = self.class.find obj.id
41
+ other_instance = Region.find obj.id
42
42
  other_instance.update_attributes :note => name + "!"
43
43
  end
44
44
  end
@@ -11,6 +11,6 @@ end
11
11
  require "test/unit"
12
12
  require "mocha"
13
13
  require "active_support"
14
- require "ruby-debug"
14
+ # require "ruby-debug"
15
15
  require File.expand_path("../../lib/friendly_id", __FILE__)
16
16
  require File.expand_path("../../lib/friendly_id/test", __FILE__)
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 3
7
7
  - 0
8
- - 5
9
- version: 3.0.5
8
+ - 6
9
+ version: 3.0.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - Norman Clarke
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-06-10 00:00:00 -04:00
19
+ date: 2010-06-11 00:00:00 -04:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency