effective_slugs 1.1.1 → 1.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 077a75e80b6da2c96419f222b12cbd1a8222e497
4
- data.tar.gz: 6ee8fb4f6fdfbfd1267da9f642e4527bc0a8f0f5
3
+ metadata.gz: bdada7ba62e00416f375f44f4c5fe494435055a6
4
+ data.tar.gz: 2cd9e9827f0ec23486c620bfbd35a7dcbe966c08
5
5
  SHA512:
6
- metadata.gz: 80367506d043988d5cdae12f85c29f2a2188f9a1829143481c18d01f49874e1e674d939420575943dbba5cc0b48f2ccb7bb7ee5c61d4ba1a65997ba2cd7c491d
7
- data.tar.gz: c7beee73d3b0be731af61aa4a81e40dd97be9ea84e86c6827087502647704a1782cc3f7890e9688aeebb204e55e25c10f0c5cac99ed01628b19a8a95b0a7ec46
6
+ metadata.gz: ee0d99edd08b84e9b02ea3d83c858e9202af6822b9297c2c36820367f5c82280e56afdd95103bb91ffc91c96e3f96a60e11ee9da5e56747209c1f924319f5a7f
7
+ data.tar.gz: e06ef0288e8dfbdb896b35d04cd9ac6ffb39da08284f88fb42903a3b560203d47afb218f7b780b2c59f34c30dc24b23bdbf8856f338cb5d560c07f821aab7e65
@@ -60,7 +60,8 @@ module ActsAsSluggable
60
60
 
61
61
  validates_presence_of :slug
62
62
  validates_exclusion_of :slug, :in => EffectiveSlugs.all_excluded_slugs
63
- validates_format_of :slug, :with => /\A[a-zA-Z0-9_-]*\z/, :message => 'only _ and - symbols allowed'
63
+ validates_length_of :slug, :maximum => 255
64
+ validates_format_of :slug, :with => /\A[a-zA-Z0-9_-]*\z/, :message => 'only _ and - symbols allowed. no spaces either.'
64
65
 
65
66
  if @acts_as_sluggable_opts[:validation_scope]
66
67
  validates_uniqueness_of :slug, :scope => @acts_as_sluggable_opts[:validation_scope]
@@ -111,7 +112,11 @@ module ActsAsSluggable
111
112
 
112
113
  module FinderMethods
113
114
  def find(*args)
114
- regular_find?(args) ? super : find_by_slug(args)
115
+ if regular_find?(args)
116
+ super
117
+ else
118
+ find_by_slug(args) or raise ::ActiveRecord::RecordNotFound
119
+ end
115
120
  end
116
121
 
117
122
  def exists?(*args)
@@ -1,3 +1,3 @@
1
1
  module EffectiveSlugs
2
- VERSION = '1.1.1'.freeze
2
+ VERSION = '1.1.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_slugs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-03 00:00:00.000000000 Z
11
+ date: 2015-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails