railhead_permalink 0.1.12 → 0.1.13

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.
@@ -36,15 +36,15 @@ module RailheadPermalink
36
36
  module InstanceMethods
37
37
  def create_permalink
38
38
  if self.permalink.nil? or not permalink_options[:keep_existing]
39
- key, counter = self[permalink_options[:field]].parameterize.to_s, '-1'
39
+ key = self[permalink_options[:field]].parameterize.to_s
40
40
  unless self.permalink == key
41
- permalink = key
41
+ permalink, counter = key, '-1'
42
42
  while permalink_options[:reserved_names].include?(permalink) or permalink.blank? or
43
43
  (object = self.class.find_without_permalink(:first, :conditions => {:permalink => permalink}) and object != self)
44
44
  counter.succ!
45
45
  permalink = key + counter
46
46
  end
47
- self[:permalink] = permalink
47
+ self.permalink = permalink
48
48
  end
49
49
  end
50
50
  end
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "railhead_permalink"
3
- s.version = "0.1.12"
4
- s.date = "2009-10-14"
3
+ s.version = "0.1.13"
4
+ s.date = "2010-03-06"
5
5
  s.summary = "RailheadPermalink is a Ruby on Rails plugin that automatically finds ActiveRecord objects with permalink."
6
6
  s.email = "nagybence@tipogral.hu"
7
7
  s.homepage = "http://github.com/nagybence/railhead_permalink"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railhead_permalink
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bence Nagy
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-14 00:00:00 +02:00
12
+ date: 2010-03-06 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies: []
15
15