friendly_id 3.0.0.beta2 → 3.0.0.beta3

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,11 +4,7 @@ module FriendlyId
4
4
  initializer "friendly_id.configure_rails_initialization" do |app|
5
5
  # Experimental Sequel support. See: http://github.com/norman/friendly_id_sequel
6
6
  if app.config.generators.rails[:orm] == :sequel
7
- begin
8
- require "friendly_id/sequel"
9
- rescue LoadError
10
- raise "To use FriendlyId's Sequel adapter, please 'gem install friendly_id_sequel'"
11
- end
7
+ require "friendly_id/sequel"
12
8
  else
13
9
  # Only Sequel and ActiveRecord are currently supported; AR is the default.
14
10
  # Want Datamapper support? http://github.com/norman/friendly_id/issues#issue/24
@@ -19,5 +15,6 @@ module FriendlyId
19
15
  rake_tasks do
20
16
  load "tasks/friendly_id.rake"
21
17
  end
18
+
22
19
  end
23
20
  end
@@ -0,0 +1,5 @@
1
+ begin
2
+ require "friendly_id_sequel"
3
+ rescue LoadError
4
+ raise "To use FriendlyId's Sequel adapter, please `gem install friendly_id_sequel`"
5
+ end
@@ -172,9 +172,10 @@ module FriendlyId
172
172
 
173
173
  test "should remain findable by previous slugs" do
174
174
  old_friendly_id = instance.friendly_id
175
- instance.update_attributes :name => "#{old_friendly_id} updated"
175
+ instance.name = "#{old_friendly_id} updated"
176
+ instance.send(save_method)
176
177
  assert_not_equal old_friendly_id, instance.friendly_id
177
- assert_equal instance, klass.find(old_friendly_id)
178
+ assert_equal instance, klass.send(find_method, old_friendly_id)
178
179
  end
179
180
 
180
181
  test "should not create a slug when allow_nil is true and friendy_id text is blank" do
@@ -3,7 +3,7 @@ module FriendlyId
3
3
  MAJOR = 3
4
4
  MINOR = 0
5
5
  TINY = 0
6
- BUILD = "beta2"
6
+ BUILD = "beta3"
7
7
  STRING = [MAJOR, MINOR, TINY, BUILD].compact.join('.')
8
8
  end
9
9
  end
data/lib/friendly_id.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require "active_support/core_ext/class/attribute_accessors"
2
+ require "active_support/core_ext/object/blank"
2
3
 
3
4
  require File.join(File.dirname(__FILE__), "friendly_id", "slug_string")
4
5
  require File.join(File.dirname(__FILE__), "friendly_id", "configuration")
metadata CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 3
7
7
  - 0
8
8
  - 0
9
- - beta2
10
- version: 3.0.0.beta2
9
+ - beta3
10
+ version: 3.0.0.beta3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Norman Clarke
@@ -68,6 +68,7 @@ files:
68
68
  - lib/friendly_id/configuration.rb
69
69
  - lib/friendly_id/finders.rb
70
70
  - lib/friendly_id/railtie.rb
71
+ - lib/friendly_id/sequel.rb
71
72
  - lib/friendly_id/slug_string.rb
72
73
  - lib/friendly_id/slugged.rb
73
74
  - lib/friendly_id/status.rb