refinerycms-slideshow 2.0.10.4 → 2.0.10.5
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.
data/CHANGELOG.md
CHANGED
@@ -21,15 +21,14 @@ module Refinery::Slideshow::Concerns::ModelWithSlideShow
|
|
21
21
|
end
|
22
22
|
|
23
23
|
# In slideshow accesor we check if this record has no slideshow but should have it, then we create a new slideshow
|
24
|
-
define_method
|
24
|
+
define_method slideshow_relationship_name do
|
25
25
|
|
26
26
|
# We try to get the slideshow using the relationship
|
27
|
-
local_slideshow = self[slideshow_relationship_name.
|
27
|
+
local_slideshow = Refinery::Slideshow::Slideshow.find(self[:"#{slideshow_relationship_name}_id"]) unless self[:"#{slideshow_relationship_name}_id"].nil?
|
28
28
|
|
29
29
|
# If slideshow is nil, and the object has been already saved and the object needs an slideshow then we create it
|
30
30
|
if local_slideshow.nil? && !self.new_record? && self.send("needs_#{slideshow_relationship_name}?")
|
31
31
|
local_slideshow = self.send("build_#{slideshow_relationship_name}", attached: self)
|
32
|
-
self[slideshow_relationship_name.to_sym] = local_slideshow
|
33
32
|
send "#{slideshow_relationship_name}=", local_slideshow
|
34
33
|
self.save
|
35
34
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: refinerycms-slideshow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.10.
|
4
|
+
version: 2.0.10.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-09-
|
12
|
+
date: 2013-09-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: refinerycms-core
|