railhead_permalink 0.2.7 → 0.3.0

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: b5cb05a65d4458fb272ca2370bbdec5edecd2d87
4
- data.tar.gz: 24e179aec7e8c65797bfc5497520b68b465fc958
3
+ metadata.gz: 1df951f172d983cb4441b50dd86d57033ac5c38d
4
+ data.tar.gz: 361f8886278022895a3eca95f398d9ca7495a9d0
5
5
  SHA512:
6
- metadata.gz: 924e77492ee2599253e40490c522af84aae97ffbbca4554d24cfaa402a212975579e7ea0fdf9c26727768cf10aed7352747b963ef9d45ff9462ce4c40d895720
7
- data.tar.gz: 57c59e84877f31773d05b413e9b7b523eb92921fea5208d2a903afb7e1e9b9d6f2805329daf4272e48b57a5f0f5b307d5dad92bec600d0f440e41b17d5f0e21a
6
+ metadata.gz: 0d9755006f6bd7d8c0f6a89f865c5755e5a7c5e27d24c75d64435d77e0891def0f0914770501eda7b55b8294b3ec7ce239a51c3538bc0c6434d9e908ad7236d1
7
+ data.tar.gz: 5a0799954487dd0897f5153ccfc2831265227664ab74317a9215fcd6d3ee5ec1bab43bdbac98a0526df6d179590a7fff929d5a257c3359c7a060a2db3b75485d
@@ -1,6 +1,6 @@
1
1
  begin
2
2
  require 'stringex_lite'
3
- # stringex fix
3
+ # stringex 2.7.1 fix | 'Auður Ava Ólafdóttir'.to_url => "audur-ava-lafdottir"
4
4
  class String
5
5
  def to_url
6
6
  Stringex::Unidecoder.decode(self).parameterize
@@ -32,21 +32,21 @@ module RailheadPermalink
32
32
  class_attribute :permalink_options
33
33
 
34
34
  self.permalink_options = {
35
- :field => field,
36
- :keep_existing => (options[:keep_existing] || false),
37
- :reserved_names => (options[:reserved_names] || []),
38
- :unique => (options[:unique] || false)
35
+ field: field,
36
+ keep_existing: (options[:keep_existing] || false),
37
+ reserved_names: (options[:reserved_names] || []),
38
+ unique: (options[:unique] || false)
39
39
  }
40
40
 
41
41
  before_save :create_permalink
42
42
  validates_presence_of field
43
- validates_uniqueness_of field, :case_sensitive => false, :if => "#{field}_changed?".to_sym if permalink_options[:unique]
43
+ validates_uniqueness_of field, case_sensitive: false, if: "#{field}_changed?".to_sym if permalink_options[:unique]
44
44
  end
45
45
 
46
46
  def find_with_permalink(*args)
47
47
  key = args.first
48
48
  if key.is_a?(String)
49
- where(:permalink => key).first || find_without_permalink(*args)
49
+ find_by(permalink: key) || find_without_permalink(*args)
50
50
  else
51
51
  find_without_permalink(*args)
52
52
  end
@@ -62,7 +62,7 @@ module RailheadPermalink
62
62
  unless self.permalink == key
63
63
  permalink, counter = key, '-1'
64
64
  while permalink_options[:reserved_names].include?(permalink) or permalink.blank? or
65
- (object = self.class.where(:permalink => permalink).first and object != self)
65
+ (object = self.class.where(permalink: permalink).first and object != self)
66
66
  counter.succ!
67
67
  permalink = key + counter
68
68
  end
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "railhead_permalink"
3
- s.version = "0.2.7"
4
- s.date = "2017-03-28"
3
+ s.version = "0.3.0"
4
+ s.date = "2017-08-29"
5
5
  s.summary = "RailheadPermalink is a Ruby on Rails plugin that automatically finds ActiveRecord objects with permalink."
6
6
  s.email = "bence.nagy@gmail.com"
7
7
  s.homepage = "http://github.com/nagybence/railhead_permalink"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railhead_permalink
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bence Nagy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-28 00:00:00.000000000 Z
11
+ date: 2017-08-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: bence.nagy@gmail.com