railhead_permalink 0.1.16 → 0.1.17

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,12 +16,13 @@ module RailheadPermalink
16
16
  write_inheritable_attribute(:permalink_options, {
17
17
  :field => field,
18
18
  :keep_existing => (options[:keep_existing] || false),
19
- :reserved_names => (options[:reserved_names] || []).concat(ActionController::Base.resources_path_names.values)
19
+ :reserved_names => (options[:reserved_names] || []).concat(ActionController::Base.resources_path_names.values),
20
+ :unique => (options[:unique] || false)
20
21
  })
21
22
 
22
23
  before_save :create_permalink
23
24
  validates_presence_of field
24
- validates_uniqueness_of field, :case_sensitive => false, :if => "#{field}_changed?".to_sym
25
+ validates_uniqueness_of field, :case_sensitive => false, :if => "#{field}_changed?".to_sym if permalink_options[:unique]
25
26
  end
26
27
 
27
28
  def find_with_permalink(*args)
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "railhead_permalink"
3
- s.version = "0.1.16"
4
- s.date = "2011-09-29"
3
+ s.version = "0.1.17"
4
+ s.date = "2011-10-12"
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,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railhead_permalink
3
3
  version: !ruby/object:Gem::Version
4
- hash: 59
4
+ hash: 57
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 16
10
- version: 0.1.16
9
+ - 17
10
+ version: 0.1.17
11
11
  platform: ruby
12
12
  authors:
13
13
  - Bence Nagy
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-09-29 00:00:00 +02:00
18
+ date: 2011-10-12 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies: []
21
21