andrewtimberlake-couch_potato 0.2.8.2 → 0.2.8.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -23,8 +23,13 @@ module CouchPotato
23
23
 
24
24
  define_method "#{name}" do
25
25
  value = self.instance_variable_get("@#{name}")
26
- default = options[:default]
27
- value.blank? ? default : value
26
+ if value.blank? && options[:default]
27
+ default = clone_attribute(options[:default])
28
+ self.instance_variable_set("@#{name}", default)
29
+ default
30
+ else
31
+ value
32
+ end
28
33
  end
29
34
 
30
35
  define_method "#{name}=" do |value|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: andrewtimberlake-couch_potato
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8.2
4
+ version: 0.2.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Lang