slugger 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/slugger.rb +1 -1
- data/spec/schema.rb +2 -2
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0
|
1
|
+
0.1.0
|
data/lib/slugger.rb
CHANGED
@@ -7,7 +7,7 @@ module Slugger
|
|
7
7
|
base.extend(ClassMethods)
|
8
8
|
end
|
9
9
|
module ClassMethods
|
10
|
-
def
|
10
|
+
def has_slug(title_column=nil,sluger_options={})
|
11
11
|
class_inheritable_accessor :sluger_options
|
12
12
|
sluger_options[:title_column] ||= title_column || 'title'
|
13
13
|
# sluger_options[:title_column] ||= 'title'
|
data/spec/schema.rb
CHANGED
@@ -28,11 +28,11 @@ CreateSchema.suppress_messages do
|
|
28
28
|
end
|
29
29
|
|
30
30
|
class Post < ActiveRecord::Base
|
31
|
-
|
31
|
+
has_slug
|
32
32
|
end
|
33
33
|
|
34
34
|
class User < ActiveRecord::Base
|
35
|
-
|
35
|
+
has_slug [:first_name, :last_name]
|
36
36
|
|
37
37
|
def name
|
38
38
|
[first_name, last_name].compact.join(' ')
|
metadata
CHANGED