manual_slug 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4b99c2e9be9b809346facf138a466fc21aca8ad0afe78eb85185c9b14e1db94f
4
- data.tar.gz: ce70515bae72f0968a3e59ecbc4d6524b1489f0949d252e2aecc049a6bfb0885
3
+ metadata.gz: 39d21e04468bf80aee597c2517b8ac4c466178152a1c3d8bbdd084f03d06f64a
4
+ data.tar.gz: 6c7151f188c747b00e7cce2b7661e8703dcad4cf2b6e65ce88d5990391ba1080
5
5
  SHA512:
6
- metadata.gz: 4d594c54b00b8b7d4d35203d48828a7afbfb9bae6be91414d2b0faf066f2f8e1125449baf3d787db0f85c76eb59acfac382c55ef7f90a8feb04f4aca241e7305
7
- data.tar.gz: 86d621a6dfdae2f2bbc9583e5f227a83054a46b21ca3aeb6e0b4c41c5a733eb64a98734cc066bc9f4622094bdfc460622496cdc37aaa984ebc19d5715e10e49a
6
+ metadata.gz: 8660e413daad102ee275453784c5de40e6d041d56ef064a78b4c5d66621118cb9d74df49ce077e072c86767d5d360dc66711c29e9144c6b305b00f574065fc10
7
+ data.tar.gz: b22ffa53afe18af5f8df5b073789b8cf1d8b4907802a04d61c1c7ff33c70736879b1e6110db1c10665f73ab23e0bb6575bb98a6da691dcd592649a0ac37ba186
@@ -14,7 +14,12 @@ module ManualSlug::ActiveRecord
14
14
 
15
15
  module ClassMethods
16
16
  def manual_slug(field, options = {}, callback = true)
17
- friendly_id field, use: [:slugged, :finders]
17
+ unless options.key?(:use)
18
+ options[:use] = [:slugged, :finders]
19
+ end
20
+
21
+ friendly_id field, options
22
+
18
23
  define_method(:should_generate_new_friendly_id?) do
19
24
  slug.blank?
20
25
  end
@@ -20,7 +20,13 @@ module ManualSlug::Mongoid
20
20
 
21
21
  module ClassMethods
22
22
  def manual_slug(field, options = {}, callback = true)
23
- options.merge!(permanent: true, history: true)
23
+ unless options.key?(:permanent)
24
+ options[:permanent] = true
25
+ end
26
+ unless options.key?(:history)
27
+ options[:history] = true
28
+ end
29
+
24
30
  slug field, options
25
31
 
26
32
  # we will create slugs manually when needed
@@ -1,3 +1,3 @@
1
1
  module ManualSlug
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: manual_slug
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - glebtv