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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5d0853a2b764780620c528b3e2e2d28afa5125b7
4
- data.tar.gz: 7b3a5fc779b8bc4393a497d16e244f84ec7c55b5
3
+ metadata.gz: 12414f97ba5ec4f81c60d1a7256b5e7adb5d1c38
4
+ data.tar.gz: 313611b1f47caf5b10138a011fd5237b4b0ebba8
5
5
  SHA512:
6
- metadata.gz: f46f384c9aed8c0ea11d7c9c8a5f1494e215d84e25c571befde09f66ebbd7206607534a4133a04a710dd990b05299ad4599550105ef3c42e2243513c7f99d9d0
7
- data.tar.gz: 0e7174384de43d73ec231513b1f378c69f10235c8cb9665fce10dc25ce36042519f07161aa9b18f2bffdef6487f3959a792f2a8f694f212f024d1f73ecce4bc5
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).settings : DEFAULTS
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
@@ -1,3 +1,3 @@
1
1
  module Polyblock
2
- VERSION = "0.8.6"
2
+ VERSION = "0.8.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polyblock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.6
4
+ version: 0.8.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - MacKinley Smith