refinerycms-slideshow 2.0.10.4 → 2.0.10.5

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 2.0.10.5 [2013-09-03]
2
+
3
+ * FIX: Slideshows got duplicated in objects which needed slideshows
4
+
1
5
  ## 2.0.10.4 [2013-09-02]
2
6
 
3
7
  * FIX: Slideshows admin should not list attached ones
@@ -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 "#{slideshow_relationship_name}" do
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.to_sym]
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
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-02 00:00:00.000000000 Z
12
+ date: 2013-09-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: refinerycms-core