simple_slugs 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,16 +1,12 @@
1
1
  module SimpleSlugs
2
2
  module ActMacro
3
3
  def has_slug(options = {})
4
- return if has_slug?
4
+ return if respond_to?(:slugger)
5
5
 
6
6
  before_validation lambda { |record| record.slugger.unique_slug!(record) }
7
7
 
8
8
  class_inheritable_accessor :slugger
9
9
  self.slugger = Slugger.new(self, options)
10
10
  end
11
-
12
- def has_slug?
13
- included_modules.include?(SimpleSlugs)
14
- end
15
11
  end
16
12
  end
@@ -24,18 +24,5 @@ module SimpleSlugs
24
24
  def dasherize
25
25
  gsub!(' ', '-')
26
26
  end
27
-
28
- # def normalize(ascii = false)
29
- # if ascii
30
- # approximate_ascii
31
- # to_ascii
32
- # end
33
- # clean
34
- # word_chars
35
- # clean
36
- # downcase
37
- # truncate_bytes(255)
38
- # with_dashes
39
- # end
40
27
  end
41
28
  end
@@ -1,3 +1,6 @@
1
+ require 'active_support/ordered_options'
2
+ require 'active_support/core_ext/hash/reverse_merge'
3
+
1
4
  module SimpleSlugs
2
5
  class Slugger < ActiveSupport::InheritableOptions
3
6
  DEFAULTS = {
@@ -1,3 +1,3 @@
1
1
  module SimpleSlugs
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/simple_slugs.rb CHANGED
@@ -1,5 +1,4 @@
1
- require 'active_support/ordered_options'
2
- require 'active_support/core_ext/hash/reverse_merge'
1
+ require 'active_record'
3
2
 
4
3
  module SimpleSlugs
5
4
  autoload :Slug, 'simple_slugs/slug'
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_slugs
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sven Fuchs
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-01 00:00:00 +02:00
18
+ date: 2010-08-04 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency