teambox-permalink_fu 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/permalink_fu.rb CHANGED
@@ -10,7 +10,7 @@ module PermalinkFu
10
10
  ClassMethods.setup_permalink_fu_on self do
11
11
  self.permalink_attributes = Array(attr_names)
12
12
  self.permalink_field = (permalink_field || 'permalink').to_s
13
- self.permalink_options = {:unique => true}.update(options)
13
+ self.permalink_options = {:unique => true, :min_length => 1}.update(options)
14
14
  end
15
15
 
16
16
  include InstanceMethods
@@ -135,7 +135,7 @@ module PermalinkFu
135
135
 
136
136
  def create_permalink_for(attr_names)
137
137
  str = attr_names.collect { |attr_name| send(attr_name).to_s } * " "
138
- str.blank? ? PermalinkFu::ClassMethods.random_permalink : str
138
+ (str.blank? || str.length < self.class.permalink_options[:min_length]) ? PermalinkFu::ClassMethods.random_permalink : str
139
139
  end
140
140
 
141
141
  private
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "teambox-permalink_fu"
6
- s.version = "1.0.1"
6
+ s.version = "1.0.2"
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Gonçalo Silva", "Charles Barbier"]
9
9
  s.email = ["goncalossilva@gmail.com", "unixcharles@gmail.com"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: teambox-permalink_fu
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 1
10
- version: 1.0.1
9
+ - 2
10
+ version: 1.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Gon\xC3\xA7alo Silva"
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-12-14 00:00:00 +01:00
19
+ date: 2011-09-20 00:00:00 +02:00
20
20
  default_executable:
21
21
  dependencies: []
22
22