slugger 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.2.0
data/lib/slugger.rb CHANGED
@@ -12,7 +12,6 @@ module Slugger
12
12
  default_options = {
13
13
  :title_column => 'title',
14
14
  :slug_column => 'slug',
15
- :as_param => true,
16
15
  :substitution_char => '-',
17
16
  :downcase => true,
18
17
  :on_conflict => :error
@@ -36,26 +35,12 @@ module Slugger
36
35
  end
37
36
 
38
37
  send :define_method, :column_to_slug, lambda { self.send(slugger_options[:title_column]) }
39
-
40
- class << self
41
- def find(*args)
42
- if self.slugger_options[:as_param] && args.first.is_a?(String)
43
- find_by_slug(args)
44
- else
45
- super(*args)
46
- end
47
- end
48
- end
49
38
 
50
39
  include InstanceMethods
51
40
  end
52
41
  end
53
42
  module InstanceMethods
54
43
 
55
- def to_param
56
- slugger_options[:as_param] ? self.slug : self.id
57
- end
58
-
59
44
  protected
60
45
 
61
46
  def permalize
@@ -2,7 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  # class Edge < ActiveRecord::Base
4
4
  # has_slug 'name', :slug_column => :slug_name,
5
- # :as_param => false,
6
5
  # :substitution_char => "_",
7
6
  # :downcase => false,
8
7
  # :on_conflict => :concat_random_chars
data/spec/schema.rb CHANGED
@@ -42,7 +42,6 @@ end
42
42
 
43
43
  class Edge < ActiveRecord::Base
44
44
  has_slug 'name', :slug_column => :slug_name,
45
- :as_param => false,
46
45
  :substitution_char => "_",
47
46
  :downcase => false,
48
47
  :on_conflict => :concat_random_chars
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slugger
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 1
9
- - 1
10
- version: 0.1.1
8
+ - 2
9
+ - 0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Seth Faxon
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-08-24 00:00:00 Z
18
+ date: 2011-08-28 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: activerecord