friendly_id 3.0.0.beta3 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. data/Changelog.md +2 -5
  2. data/Rakefile +1 -1
  3. data/extras/extras.rb +1 -1
  4. data/lib/friendly_id.rb +1 -0
  5. data/lib/friendly_id/active_record.rb +8 -8
  6. data/lib/friendly_id/{acktive_record → active_record_adapter}/configuration.rb +5 -2
  7. data/lib/friendly_id/{acktive_record → active_record_adapter}/finders.rb +7 -5
  8. data/lib/friendly_id/{acktive_record → active_record_adapter}/simple_model.rb +4 -5
  9. data/lib/friendly_id/{acktive_record → active_record_adapter}/slug.rb +1 -1
  10. data/lib/friendly_id/{acktive_record → active_record_adapter}/slugged_model.rb +5 -6
  11. data/lib/friendly_id/{acktive_record → active_record_adapter}/tasks.rb +6 -6
  12. data/lib/friendly_id/finders.rb +6 -5
  13. data/lib/friendly_id/version.rb +1 -1
  14. data/test/{acktive_record → active_record_adapter}/basic_slugged_model_test.rb +3 -3
  15. data/test/{acktive_record → active_record_adapter}/cached_slug_test.rb +3 -3
  16. data/test/{acktive_record → active_record_adapter}/core.rb +1 -1
  17. data/test/{acktive_record → active_record_adapter}/custom_normalizer_test.rb +3 -3
  18. data/test/{acktive_record → active_record_adapter}/custom_table_name_test.rb +3 -3
  19. data/test/{acktive_record → active_record_adapter}/scoped_model_test.rb +2 -2
  20. data/test/{acktive_record → active_record_adapter}/simple_test.rb +2 -2
  21. data/test/{acktive_record → active_record_adapter}/slug_test.rb +0 -0
  22. data/test/{acktive_record → active_record_adapter}/slugged.rb +1 -1
  23. data/test/{acktive_record → active_record_adapter}/slugged_status_test.rb +1 -1
  24. data/test/{acktive_record → active_record_adapter}/sti_test.rb +3 -3
  25. data/test/active_record_adapter/support/database.jdbcsqlite3.yml +2 -0
  26. data/test/{acktive_record → active_record_adapter}/support/database.mysql.yml +0 -0
  27. data/test/{acktive_record → active_record_adapter}/support/database.postgres.yml +0 -0
  28. data/test/{acktive_record → active_record_adapter}/support/database.sqlite3.yml +0 -0
  29. data/test/{acktive_record → active_record_adapter}/support/models.rb +0 -0
  30. data/test/{acktive_record → active_record_adapter}/tasks_test.rb +1 -1
  31. data/test/{acktive_record → active_record_adapter}/test_helper.rb +1 -1
  32. metadata +37 -39
  33. data/test/acktive_record/temp_test.rb +0 -32
data/Changelog.md CHANGED
@@ -6,15 +6,12 @@ suggestions, ideas and improvements to FriendlyId.
6
6
  * Table of Contents
7
7
  {:toc}
8
8
 
9
- ## 3.0.0 (NOT RELEASED YET)
9
+ ## 3.0.0 (2010-03-30)
10
10
 
11
11
  * Rails 3 support.
12
12
  * Removed features deprecated in FriendlyId 2.3.
13
-
14
- ## 2.3.5 (NOT RELEASED YET)
15
-
16
13
  * Fixed searching by numeric friendly_id in non-slugged models.
17
- * Added allow_nil option (Andre Duffeck and Norman Clarke)
14
+ * Added :allow_nil config option (Andre Duffeck and Norman Clarke)
18
15
 
19
16
  ## 2.3.4 (2010-03-22)
20
17
 
data/Rakefile CHANGED
@@ -44,7 +44,7 @@ namespace :test do
44
44
  sh "cd fid; rake test"
45
45
  end
46
46
  Rake::TestTask.new(:friendly_id) { |t| t.pattern = "test/*_test.rb" }
47
- Rake::TestTask.new(:ar) { |t| t.pattern = "test/acktive_record/*_test.rb" }
47
+ Rake::TestTask.new(:ar) { |t| t.pattern = "test/active_record_adapter/*_test.rb" }
48
48
 
49
49
  namespace :rails do
50
50
  task :plugin do
data/extras/extras.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby -KU
2
2
  require File.dirname(__FILE__) + '/../test/test_helper'
3
- require File.dirname(__FILE__) + '/../test/acktive_record/test_helper'
3
+ require File.dirname(__FILE__) + '/../test/active_record_adapter/test_helper'
4
4
  require 'ffaker'
5
5
 
6
6
  TIMES = (ENV['N'] || 100).to_i
data/lib/friendly_id.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require "forwardable"
1
2
  require "active_support/core_ext/class/attribute_accessors"
2
3
  require "active_support/core_ext/object/blank"
3
4
 
@@ -1,6 +1,6 @@
1
1
  module FriendlyId
2
2
 
3
- module AcktiveRecord
3
+ module ActiveRecordAdapter
4
4
 
5
5
  module Compat
6
6
  def self.scope_method
@@ -41,12 +41,12 @@ module FriendlyId
41
41
  end
42
42
 
43
43
  class ActiveRecord::Base
44
- extend FriendlyId::AcktiveRecord
44
+ extend FriendlyId::ActiveRecordAdapter
45
45
  end
46
46
 
47
- require File.join(File.dirname(__FILE__), "acktive_record", "configuration")
48
- require File.join(File.dirname(__FILE__), "acktive_record", "finders")
49
- require File.join(File.dirname(__FILE__), "acktive_record", "simple_model")
50
- require File.join(File.dirname(__FILE__), "acktive_record", "slugged_model")
51
- require File.join(File.dirname(__FILE__), "acktive_record", "slug")
52
- require File.join(File.dirname(__FILE__), "acktive_record", "tasks")
47
+ require File.join(File.dirname(__FILE__), "active_record_adapter", "configuration")
48
+ require File.join(File.dirname(__FILE__), "active_record_adapter", "finders")
49
+ require File.join(File.dirname(__FILE__), "active_record_adapter", "simple_model")
50
+ require File.join(File.dirname(__FILE__), "active_record_adapter", "slugged_model")
51
+ require File.join(File.dirname(__FILE__), "active_record_adapter", "slug")
52
+ require File.join(File.dirname(__FILE__), "active_record_adapter", "tasks")
@@ -1,13 +1,16 @@
1
1
  module FriendlyId
2
- module AcktiveRecord
3
2
 
3
+ module ActiveRecordAdapter
4
+
5
+ # Extends FriendlyId::Configuration with some implementation details and
6
+ # features specific to ActiveRecord.
4
7
  class Configuration < FriendlyId::Configuration
5
8
 
6
9
  # The column used to cache the friendly_id string. If no column is specified,
7
10
  # FriendlyId will look for a column named +cached_slug+ and use it automatically
8
11
  # if it exists. If for some reason you have a column named +cached_slug+
9
12
  # but don't want FriendlyId to modify it, pass the option
10
- # +:cache_column => false+ to {FriendlyId::AcktiveRecord#has_friendly_id has_friendly_id}.
13
+ # +:cache_column => false+ to {FriendlyId::ActiveRecordAdapter#has_friendly_id has_friendly_id}.
11
14
  attr_accessor :cache_column
12
15
 
13
16
  # An array of classes for which the configured class serves as a
@@ -2,7 +2,7 @@ module FriendlyId
2
2
 
3
3
  # The adapter for Ruby on Rails's ActiveRecord. Compatible with AR 2.2.x -
4
4
  # 2.3.x.
5
- module AcktiveRecord
5
+ module ActiveRecordAdapter
6
6
 
7
7
  # The classes in this module are used internally by FriendlyId, and exist
8
8
  # largely to avoid polluting the ActiveRecord models with too many
@@ -16,22 +16,22 @@ module FriendlyId
16
16
  # a cached or uncached finder.
17
17
  class FinderProxy
18
18
 
19
+ extend Forwardable
20
+
19
21
  attr_reader :finder
20
22
  attr :finder_class
21
23
  attr :ids
22
24
  attr :model_class
23
25
  attr :options
24
26
 
27
+ def_delegators :finder, :find, :unfriendly?
28
+
25
29
  def initialize(model_class, *args, &block)
26
30
  @model_class = model_class
27
31
  @ids = args.shift
28
32
  @options = args.first.kind_of?(Hash) ? args.first : {}
29
33
  end
30
34
 
31
- def method_missing(symbol, *args)
32
- finder.send(symbol, *args)
33
- end
34
-
35
35
  # Perform the find query.
36
36
  def finder
37
37
  @finder ||= finder_class.new(ids, model_class, options)
@@ -85,6 +85,8 @@ module FriendlyId
85
85
  # @abstract
86
86
  module Multiple
87
87
 
88
+ include FriendlyId::Finders::Base
89
+
88
90
  attr_reader :friendly_ids, :results, :unfriendly_ids
89
91
 
90
92
  def initialize(ids, model_class, options={})
@@ -1,5 +1,5 @@
1
1
  module FriendlyId
2
- module AcktiveRecord
2
+ module ActiveRecordAdapter
3
3
 
4
4
  module SimpleModel
5
5
 
@@ -20,8 +20,7 @@ module FriendlyId
20
20
 
21
21
  class MultipleFinder
22
22
 
23
- include FriendlyId::Finders::Base
24
- include FriendlyId::AcktiveRecord::Finders::Multiple
23
+ include FriendlyId::ActiveRecordAdapter::Finders::Multiple
25
24
  include SimpleFinder
26
25
 
27
26
  def find
@@ -71,7 +70,7 @@ module FriendlyId
71
70
  validates_presence_of column, :unless => :skip_friendly_id_validations
72
71
  validates_length_of column, :maximum => friendly_id_config.max_length, :unless => :skip_friendly_id_validations
73
72
  after_update :update_scopes
74
- extend FriendlyId::AcktiveRecord::FinderMethods
73
+ extend FriendlyId::ActiveRecordAdapter::FinderMethods
75
74
  end
76
75
  end
77
76
 
@@ -109,7 +108,7 @@ module FriendlyId
109
108
  end
110
109
 
111
110
  def skip_friendly_id_validations
112
- friendly_id.nil? && self.class.friendly_id_config.allow_nil?
111
+ friendly_id.nil? && friendly_id_config.allow_nil?
113
112
  end
114
113
 
115
114
  def validate_friendly_id
@@ -5,7 +5,7 @@ class Slug < ::ActiveRecord::Base
5
5
  belongs_to :sluggable, :polymorphic => true
6
6
  before_save :enable_name_reversion, :set_sequence
7
7
  validate :validate_name
8
- send FriendlyId::AcktiveRecord::Compat.scope_method, :similar_to, lambda {|slug| {:conditions => {
8
+ send FriendlyId::ActiveRecordAdapter::Compat.scope_method, :similar_to, lambda {|slug| {:conditions => {
9
9
  :name => slug.name,
10
10
  :scope => slug.scope,
11
11
  :sluggable_type => slug.sluggable_type
@@ -1,5 +1,5 @@
1
1
  module FriendlyId
2
- module AcktiveRecord
2
+ module ActiveRecordAdapter
3
3
  module SluggedModel
4
4
 
5
5
  module SluggedFinder
@@ -17,14 +17,13 @@ module FriendlyId
17
17
 
18
18
  class MultipleFinder
19
19
 
20
- include FriendlyId::Finders::Base
21
- include FriendlyId::AcktiveRecord::Finders::Multiple
20
+ include FriendlyId::ActiveRecordAdapter::Finders::Multiple
22
21
  include SluggedFinder
23
22
 
24
23
  attr_reader :slugs
25
24
 
26
25
  def find
27
- @results = with_scope(:find => find_options) { all options }.uniq
26
+ @results = model_class.scoped(find_options).all(options).uniq
28
27
  raise ::ActiveRecord::RecordNotFound, error_message if @results.size != expected_size
29
28
  @results.each {|result| result.friendly_id_status.name = slug_for(result)}
30
29
  end
@@ -146,7 +145,7 @@ module FriendlyId
146
145
  after_update :update_scope
147
146
  after_update :update_dependent_scopes
148
147
  protect_friendly_id_attributes
149
- extend FriendlyId::AcktiveRecord::FinderMethods
148
+ extend FriendlyId::ActiveRecordAdapter::FinderMethods
150
149
  end
151
150
  end
152
151
 
@@ -156,7 +155,7 @@ module FriendlyId
156
155
  slugs.find_by_name_and_sequence(name, sequence)
157
156
  end
158
157
 
159
- # The model instance's current {FriendlyId::AcktiveRecord::Slug slug}.
158
+ # The model instance's current {FriendlyId::ActiveRecordAdapter::Slug slug}.
160
159
  def slug
161
160
  return @slug if new_record?
162
161
  @slug ||= slugs.first(:order => "id DESC")
@@ -1,10 +1,14 @@
1
1
  module FriendlyId
2
2
  class TaskRunner
3
3
 
4
+ extend Forwardable
5
+
4
6
  attr_accessor :days
5
7
  attr_accessor :klass
6
8
  attr_accessor :task_options
7
9
 
10
+ def_delegators :klass, :find, :friendly_id_config, :update_all
11
+
8
12
  OLD_SLUG_DAYS = 45
9
13
 
10
14
  def initialize(&block)
@@ -12,16 +16,12 @@ module FriendlyId
12
16
  self.days = ENV["DAYS"]
13
17
  end
14
18
 
15
- def method_missing(*args)
16
- klass.send(*args)
17
- end
18
-
19
19
  def days=(days)
20
- @days = days.blank? ? OLD_SLUG_DAYS : days.to_i
20
+ @days ||= days.blank? ? OLD_SLUG_DAYS : days.to_i
21
21
  end
22
22
 
23
23
  def klass=(klass)
24
- @klass = klass.to_s.classify.constantize unless klass.blank?
24
+ @klass ||= klass.to_s.classify.constantize unless klass.blank?
25
25
  end
26
26
 
27
27
  def make_slugs
@@ -4,6 +4,11 @@ module FriendlyId
4
4
 
5
5
  module Base
6
6
 
7
+ extend Forwardable
8
+
9
+ def_delegators :model_class, :base_class, :friendly_id_config,
10
+ :primary_key, :quoted_table_name, :sanitize_sql, :table_name
11
+
7
12
  # Is the id friendly or numeric? Not that the return value here is
8
13
  # +false+ if the +id+ is definitely not friendly, and +nil+ if it can
9
14
  # not be determined.
@@ -38,10 +43,6 @@ module FriendlyId
38
43
  self.scope = options.delete :scope
39
44
  end
40
45
 
41
- def method_missing(*args, &block)
42
- model_class.send(*args, &block)
43
- end
44
-
45
46
  # An array of ids; can be both friendly and unfriendly.
46
47
  attr_accessor :ids
47
48
 
@@ -105,4 +106,4 @@ module FriendlyId
105
106
  end
106
107
 
107
108
  end
108
- end
109
+ end
@@ -3,7 +3,7 @@ module FriendlyId
3
3
  MAJOR = 3
4
4
  MINOR = 0
5
5
  TINY = 0
6
- BUILD = "beta3"
6
+ BUILD = nil
7
7
  STRING = [MAJOR, MINOR, TINY, BUILD].compact.join('.')
8
8
  end
9
9
  end
@@ -2,12 +2,12 @@ require File.dirname(__FILE__) + '/test_helper'
2
2
 
3
3
  module FriendlyId
4
4
  module Test
5
- module AcktiveRecord
5
+ module ActiveRecordAdapter
6
6
  class BasicSluggedModelTest < ::Test::Unit::TestCase
7
7
  include FriendlyId::Test::Generic
8
8
  include FriendlyId::Test::Slugged
9
- include FriendlyId::Test::AcktiveRecord::Slugged
10
- include FriendlyId::Test::AcktiveRecord::Core
9
+ include FriendlyId::Test::ActiveRecordAdapter::Slugged
10
+ include FriendlyId::Test::ActiveRecordAdapter::Core
11
11
  end
12
12
  end
13
13
  end
@@ -2,14 +2,14 @@ require File.dirname(__FILE__) + '/test_helper'
2
2
 
3
3
  module FriendlyId
4
4
  module Test
5
- module AcktiveRecord
5
+ module ActiveRecordAdapter
6
6
 
7
7
  class CachedSlugTest < ::Test::Unit::TestCase
8
8
 
9
9
  include FriendlyId::Test::Generic
10
10
  include FriendlyId::Test::Slugged
11
- include FriendlyId::Test::AcktiveRecord::Slugged
12
- include FriendlyId::Test::AcktiveRecord::Core
11
+ include FriendlyId::Test::ActiveRecordAdapter::Slugged
12
+ include FriendlyId::Test::ActiveRecordAdapter::Core
13
13
 
14
14
  def klass
15
15
  District
@@ -4,7 +4,7 @@ module FriendlyId
4
4
 
5
5
  module Test
6
6
 
7
- module AcktiveRecord
7
+ module ActiveRecordAdapter
8
8
 
9
9
  module Core
10
10
 
@@ -2,12 +2,12 @@ require File.dirname(__FILE__) + '/test_helper'
2
2
 
3
3
  module FriendlyId
4
4
  module Test
5
- module AcktiveRecord
5
+ module ActiveRecordAdapter
6
6
 
7
7
  class CustomNormalizerTest < ::Test::Unit::TestCase
8
8
 
9
- include FriendlyId::Test::AcktiveRecord::Core
10
- include FriendlyId::Test::AcktiveRecord::Slugged
9
+ include FriendlyId::Test::ActiveRecordAdapter::Core
10
+ include FriendlyId::Test::ActiveRecordAdapter::Slugged
11
11
  include FriendlyId::Test::CustomNormalizer
12
12
 
13
13
  def klass
@@ -2,14 +2,14 @@ require File.dirname(__FILE__) + '/test_helper'
2
2
 
3
3
  module FriendlyId
4
4
  module Test
5
- module AcktiveRecord
5
+ module ActiveRecordAdapter
6
6
 
7
7
  class CustomTableNameTest < ::Test::Unit::TestCase
8
8
 
9
9
  include FriendlyId::Test::Generic
10
10
  include FriendlyId::Test::Slugged
11
- include FriendlyId::Test::AcktiveRecord::Slugged
12
- include FriendlyId::Test::AcktiveRecord::Core
11
+ include FriendlyId::Test::ActiveRecordAdapter::Slugged
12
+ include FriendlyId::Test::ActiveRecordAdapter::Core
13
13
 
14
14
  def klass
15
15
  Place
@@ -7,8 +7,8 @@ module FriendlyId
7
7
 
8
8
  include FriendlyId::Test::Generic
9
9
  include FriendlyId::Test::Slugged
10
- include FriendlyId::Test::AcktiveRecord::Slugged
11
- include FriendlyId::Test::AcktiveRecord::Core
10
+ include FriendlyId::Test::ActiveRecordAdapter::Slugged
11
+ include FriendlyId::Test::ActiveRecordAdapter::Core
12
12
 
13
13
  def setup
14
14
  @user = User.create!(:name => "john")
@@ -2,7 +2,7 @@ require File.dirname(__FILE__) + '/test_helper'
2
2
 
3
3
  module FriendlyId
4
4
  module Test
5
- module AcktiveRecord
5
+ module ActiveRecordAdapter
6
6
  module Simple
7
7
 
8
8
  module SimpleTest
@@ -23,7 +23,7 @@ module FriendlyId
23
23
 
24
24
  include FriendlyId::Test::Generic
25
25
  include FriendlyId::Test::Simple
26
- include FriendlyId::Test::AcktiveRecord::Core
26
+ include FriendlyId::Test::ActiveRecordAdapter::Core
27
27
  include SimpleTest
28
28
 
29
29
  test "should default to not friendly" do
@@ -2,7 +2,7 @@ require File.dirname(__FILE__) + '/test_helper'
2
2
 
3
3
  module FriendlyId
4
4
  module Test
5
- module AcktiveRecord
5
+ module ActiveRecordAdapter
6
6
  module Slugged
7
7
 
8
8
  test "should allow eager loading of slugs" do
@@ -3,7 +3,7 @@ require File.dirname(__FILE__) + '/test_helper'
3
3
 
4
4
  module FriendlyId
5
5
  module Test
6
- module AcktiveRecord
6
+ module ActiveRecordAdapter
7
7
 
8
8
  class StatusTest < ::Test::Unit::TestCase
9
9
 
@@ -2,14 +2,14 @@ require File.dirname(__FILE__) + '/test_helper'
2
2
 
3
3
  module FriendlyId
4
4
  module Test
5
- module AcktiveRecord
5
+ module ActiveRecordAdapter
6
6
 
7
7
  class StiTest < ::Test::Unit::TestCase
8
8
 
9
9
  include FriendlyId::Test::Generic
10
10
  include FriendlyId::Test::Slugged
11
- include FriendlyId::Test::AcktiveRecord::Slugged
12
- include FriendlyId::Test::AcktiveRecord::Core
11
+ include FriendlyId::Test::ActiveRecordAdapter::Slugged
12
+ include FriendlyId::Test::ActiveRecordAdapter::Core
13
13
 
14
14
  def klass
15
15
  Novel
@@ -0,0 +1,2 @@
1
+ adapter: jdbcsqlite3
2
+ database: ":memory:"
@@ -1,5 +1,5 @@
1
1
  require(File.dirname(__FILE__) + '/test_helper')
2
- require File.dirname(__FILE__) + '/../../lib/friendly_id/acktive_record/tasks'
2
+ require File.dirname(__FILE__) + '/../../lib/friendly_id/active_record_adapter/tasks'
3
3
 
4
4
  class TasksTest < Test::Unit::TestCase
5
5
 
@@ -80,7 +80,7 @@ end
80
80
  # A model that uses default slug settings and has a named scope
81
81
  class Post < ActiveRecord::Base
82
82
  has_friendly_id :name, :use_slug => true
83
- send FriendlyId::AcktiveRecord::Compat.scope_method, :published, :conditions => { :published => true }
83
+ send FriendlyId::ActiveRecordAdapter::Compat.scope_method, :published, :conditions => { :published => true }
84
84
  end
85
85
 
86
86
  # Model that uses a custom table name
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: friendly_id
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: true
4
+ prerelease: false
5
5
  segments:
6
6
  - 3
7
7
  - 0
8
8
  - 0
9
- - beta3
10
- version: 3.0.0.beta3
9
+ version: 3.0.0
11
10
  platform: ruby
12
11
  authors:
13
12
  - Norman Clarke
@@ -17,7 +16,7 @@ autorequire:
17
16
  bindir: bin
18
17
  cert_chain: []
19
18
 
20
- date: 2010-03-29 00:00:00 -03:00
19
+ date: 2010-03-30 00:00:00 -03:00
21
20
  default_executable:
22
21
  dependencies:
23
22
  - !ruby/object:Gem::Dependency
@@ -58,13 +57,13 @@ extensions: []
58
57
  extra_rdoc_files: []
59
58
 
60
59
  files:
61
- - lib/friendly_id/acktive_record/configuration.rb
62
- - lib/friendly_id/acktive_record/finders.rb
63
- - lib/friendly_id/acktive_record/simple_model.rb
64
- - lib/friendly_id/acktive_record/slug.rb
65
- - lib/friendly_id/acktive_record/slugged_model.rb
66
- - lib/friendly_id/acktive_record/tasks.rb
67
60
  - lib/friendly_id/active_record.rb
61
+ - lib/friendly_id/active_record_adapter/configuration.rb
62
+ - lib/friendly_id/active_record_adapter/finders.rb
63
+ - lib/friendly_id/active_record_adapter/simple_model.rb
64
+ - lib/friendly_id/active_record_adapter/slug.rb
65
+ - lib/friendly_id/active_record_adapter/slugged_model.rb
66
+ - lib/friendly_id/active_record_adapter/tasks.rb
68
67
  - lib/friendly_id/configuration.rb
69
68
  - lib/friendly_id/finders.rb
70
69
  - lib/friendly_id/railtie.rb
@@ -86,24 +85,24 @@ files:
86
85
  - rails/init.rb
87
86
  - generators/friendly_id/friendly_id_generator.rb
88
87
  - generators/friendly_id/templates/create_slugs.rb
89
- - test/acktive_record/basic_slugged_model_test.rb
90
- - test/acktive_record/cached_slug_test.rb
91
- - test/acktive_record/core.rb
92
- - test/acktive_record/custom_normalizer_test.rb
93
- - test/acktive_record/custom_table_name_test.rb
94
- - test/acktive_record/scoped_model_test.rb
95
- - test/acktive_record/simple_test.rb
96
- - test/acktive_record/slug_test.rb
97
- - test/acktive_record/slugged.rb
98
- - test/acktive_record/slugged_status_test.rb
99
- - test/acktive_record/sti_test.rb
100
- - test/acktive_record/support/database.mysql.yml
101
- - test/acktive_record/support/database.postgres.yml
102
- - test/acktive_record/support/database.sqlite3.yml
103
- - test/acktive_record/support/models.rb
104
- - test/acktive_record/tasks_test.rb
105
- - test/acktive_record/temp_test.rb
106
- - test/acktive_record/test_helper.rb
88
+ - test/active_record_adapter/basic_slugged_model_test.rb
89
+ - test/active_record_adapter/cached_slug_test.rb
90
+ - test/active_record_adapter/core.rb
91
+ - test/active_record_adapter/custom_normalizer_test.rb
92
+ - test/active_record_adapter/custom_table_name_test.rb
93
+ - test/active_record_adapter/scoped_model_test.rb
94
+ - test/active_record_adapter/simple_test.rb
95
+ - test/active_record_adapter/slug_test.rb
96
+ - test/active_record_adapter/slugged.rb
97
+ - test/active_record_adapter/slugged_status_test.rb
98
+ - test/active_record_adapter/sti_test.rb
99
+ - test/active_record_adapter/support/database.jdbcsqlite3.yml
100
+ - test/active_record_adapter/support/database.mysql.yml
101
+ - test/active_record_adapter/support/database.postgres.yml
102
+ - test/active_record_adapter/support/database.sqlite3.yml
103
+ - test/active_record_adapter/support/models.rb
104
+ - test/active_record_adapter/tasks_test.rb
105
+ - test/active_record_adapter/test_helper.rb
107
106
  - test/friendly_id_test.rb
108
107
  - test/slug_string_test.rb
109
108
  - test/test_helper.rb
@@ -146,16 +145,15 @@ signing_key:
146
145
  specification_version: 3
147
146
  summary: A comprehensive slugging and pretty-URL plugin.
148
147
  test_files:
149
- - test/acktive_record/basic_slugged_model_test.rb
150
- - test/acktive_record/cached_slug_test.rb
151
- - test/acktive_record/custom_normalizer_test.rb
152
- - test/acktive_record/custom_table_name_test.rb
153
- - test/acktive_record/scoped_model_test.rb
154
- - test/acktive_record/simple_test.rb
155
- - test/acktive_record/slug_test.rb
156
- - test/acktive_record/slugged_status_test.rb
157
- - test/acktive_record/sti_test.rb
158
- - test/acktive_record/tasks_test.rb
159
- - test/acktive_record/temp_test.rb
148
+ - test/active_record_adapter/basic_slugged_model_test.rb
149
+ - test/active_record_adapter/cached_slug_test.rb
150
+ - test/active_record_adapter/custom_normalizer_test.rb
151
+ - test/active_record_adapter/custom_table_name_test.rb
152
+ - test/active_record_adapter/scoped_model_test.rb
153
+ - test/active_record_adapter/simple_test.rb
154
+ - test/active_record_adapter/slug_test.rb
155
+ - test/active_record_adapter/slugged_status_test.rb
156
+ - test/active_record_adapter/sti_test.rb
157
+ - test/active_record_adapter/tasks_test.rb
160
158
  - test/friendly_id_test.rb
161
159
  - test/slug_string_test.rb
@@ -1,32 +0,0 @@
1
- require File.dirname(__FILE__) + '/test_helper'
2
-
3
-
4
- # scope :hello, :conditions => {"books.name" => "hello world"}
5
- # scope :friendly, lambda { |name| {:conditions => {"slugs.name" => name }, :include => :slugs}}
6
- #
7
- # def self.find(*args, &block)
8
- # if FriendlyId::Finders::Base.friendly?(args.first)
9
- # puts "doing friendly find with #{args.first}"
10
- # self.friendly(args.shift).first(*args)
11
- # else
12
- # super
13
- # end
14
- # end
15
- #
16
- # end
17
-
18
- module FriendlyId
19
- module Test
20
- module AcktiveRecord
21
-
22
- class StiTest < ::Test::Unit::TestCase
23
-
24
- # def test_temp
25
- # instance = Post.create(:name => "hello world")
26
- # p instance.class.find(instance.friendly_id)
27
- # end
28
- end
29
-
30
- end
31
- end
32
- end