polyblock 0.8.6 → 0.8.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/polyblock/block.rb +2 -2
- data/lib/polyblock/has_polyblock.rb +4 -0
- data/lib/polyblock/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12414f97ba5ec4f81c60d1a7256b5e7adb5d1c38
|
4
|
+
data.tar.gz: 313611b1f47caf5b10138a011fd5237b4b0ebba8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70830bb6beb082a02de1de4a33a7e2e2ec54518656feca153fff63c23988c648dbdef898c722368bd1af137232ce440e2ab333d0cad3a812890267c91553a0de
|
7
|
+
data.tar.gz: 70315af38b46cb91af728acdaa112d6e8da26c193e992de6a581c04d30afbd533a5d674769d83eedacd97005a2d03bd0b887da3a244c41fdd662d494a9cbf751
|
@@ -37,8 +37,8 @@ module Polyblock
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def settings
|
40
|
-
return settings_cache unless settings_cache.nil?
|
41
|
-
settings_cache = self.contentable.present? ? self.contentable.send(self.name)
|
40
|
+
return self.settings_cache unless self.settings_cache.nil?
|
41
|
+
self.settings_cache = self.contentable.present? ? self.contentable.send("#{self.name}_settings") : DEFAULTS
|
42
42
|
end
|
43
43
|
|
44
44
|
def to_s
|
@@ -11,6 +11,10 @@ module Polyblock
|
|
11
11
|
settings = defaults.deep_merge(options)
|
12
12
|
has_one name, -> { where(:name => name) }, settings[:association]
|
13
13
|
accepts_nested_attributes_for name, settings[:nested_attributes]
|
14
|
+
|
15
|
+
cattr_accessor "#{name}_settings".to_sym
|
16
|
+
send("#{name}_settings=".to_sym, settings)
|
17
|
+
|
14
18
|
after_initialize do
|
15
19
|
send("build_#{name}".to_sym) if send(name.to_sym).nil?
|
16
20
|
# send(name.to_sym).settings = settings
|
data/lib/polyblock/version.rb
CHANGED