vidibus-permalink 1.3.0 → 1.4.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: d118d572faff0ee081b71af77b77058c3a7226fcb9339467684fd9402ab1ba75
4
- data.tar.gz: 06f9e27805f167fde0af86c410ea42905bffaf50235404dcafe6d4201bc33412
3
+ metadata.gz: bac98f8cc4d3e6a7e575bab1edf72c67eb04eeffde1a0715d7ab8232037db918
4
+ data.tar.gz: 1d4204aea086cb8a69017ae2f0b3985839895c949f6a2dd9a780a461b41ff6bb
5
5
  SHA512:
6
- metadata.gz: 6387c90b049d3f7985b35bc4ee7aa539a6919d839ad0f5e12742b156a35e70566b3e4ae60a295ab5876add428260f53356770c080bb0da6c78792744d637cacd
7
- data.tar.gz: de8536cb2af02207d2b8145496a3deaa17819ae66e922cd3656166e5e5d841c044df6a8ce5f49b40deb2162479669ccee01e3a478b4d5f6d5afb1ecdedbf4227
6
+ metadata.gz: ff6e288516dd3863daedf254e561b1f7257d0e9cf49254c07295bf3f334ab962b6a96838076ee4653cfbd7f2e4a8d3ca49bc1f71969dbef7e7132c9666fe6ce0
7
+ data.tar.gz: ca8be7dde7894295b1ed8cdd7356be5ef24875138773df1dccd841cd2f83ee9d69c616ffe5ac5d3bacf0092998dce1dd2cc2ed219bbf08eade1c9c5efab282ad
@@ -40,6 +40,18 @@ module Vidibus
40
40
  end
41
41
  end
42
42
 
43
+ # Ensure that a current permalink object exists for this record.
44
+ def ensure_permalink_object
45
+ if permalink_repository
46
+ permalink_object || begin
47
+ obj = permalink_object_by_value(permalink)
48
+ obj.sanitize_value!
49
+ obj.current!
50
+ obj.save
51
+ end
52
+ end
53
+ end
54
+
43
55
  # Returns the defined permalink repository object.
44
56
  def permalink_repository
45
57
  @permalink_repository ||= begin
@@ -1,5 +1,5 @@
1
1
  module Vidibus
2
2
  module Permalink
3
- VERSION = '1.3.0'
3
+ VERSION = '1.4.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vidibus-permalink
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andre Pankratz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-16 00:00:00.000000000 Z
11
+ date: 2020-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport