create_custom_attributes 0.5.5 → 0.5.6

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: f69596f4a6689409538693c41d6fff7bb3b76bc0
4
- data.tar.gz: 90013847fba6e657bb13023fdb994b751c898ec7
3
+ metadata.gz: d86d6f94aede20a07b0d613605bb2bd174e7b055
4
+ data.tar.gz: 369e39943065c415c575019308aa4159287334e1
5
5
  SHA512:
6
- metadata.gz: 8595942a2702a6655a81bf7ff05a01089eccf13b14cc9b772a173780792ff2c1aa78425e0e525c6543180e862e332b04900c32a688284085dbe01e6c5937791f
7
- data.tar.gz: b7185400c440089936b44dc621ea3556b855f060ef796aba0bb94ad88757e44f2aff786cc52e2307e41b4b237599fd035d56b50ea91508f911e5fad91f7a1b13
6
+ metadata.gz: 437e7c2da35085e0b39d7fd851595ffb7beac2e5d6d450f0f7bb8d3364591af0525bb16739d54d4eaaf0b5a2707e49f4faab98d18edd39aefe2da27c34f9b02a
7
+ data.tar.gz: 5cc1238b3aa2443051f92d4a41ae67fb6455363e3c65abe8a12300f52ec118b42f93e416006428ff1ef22970079be50ed39f8202f7e02ab17aecf3fa80133a94
@@ -27,7 +27,7 @@ module CustomAttributes
27
27
  def value
28
28
  return read_attribute(:value) if new_record?
29
29
 
30
- read_attribute(:value) || custom_field.default
30
+ read_attribute(:value) || custom_field.try(:default)
31
31
  end
32
32
 
33
33
  def true?
@@ -119,7 +119,7 @@ module CustomAttributes
119
119
  def populate_custom_field_value(field)
120
120
  x = CustomAttributes::CustomFieldValue.new
121
121
  x.custom_field = field
122
- x.customizable = self
122
+ x.customizable = course
123
123
  if field.multiple?
124
124
  values = custom_values.select { |v| v.custom_field == field }
125
125
  if values.empty?
@@ -128,7 +128,7 @@ module CustomAttributes
128
128
  x.instance_variable_set('@value', values.map(&:value))
129
129
  else
130
130
  cv = custom_values.detect { |v| v.custom_field == field }
131
- cv ||= custom_values.build(customizable: self, custom_field: field)
131
+ cv ||= custom_values.build(customizable: course, custom_field: field)
132
132
  x.instance_variable_set('@value', cv.value)
133
133
  end
134
134
  x.value_was = x.value.dup if x.value
@@ -1,3 +1,3 @@
1
1
  module CustomAttributes
2
- VERSION = '0.5.5'.freeze
2
+ VERSION = '0.5.6'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: create_custom_attributes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
4
+ version: 0.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Grützmacher