freyja 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/lib/freyja/base.rb CHANGED
@@ -68,7 +68,7 @@ class Freyja::Base
68
68
  else
69
69
  value = source[attr]
70
70
  end
71
- if association[:class]
71
+ if association[:class] && value.present?
72
72
  translator = association[:class].new(value)
73
73
  result[attr] = translator.as_json
74
74
  else
@@ -87,7 +87,7 @@ class Freyja::Base
87
87
  else
88
88
  value = source[attr]
89
89
  end
90
- if association[:class]
90
+ if association[:class] && value.present?
91
91
  result[attr] = value.map do |v|
92
92
  translator = association[:class].new(v)
93
93
  translator.as_json
@@ -1,3 +1,3 @@
1
1
  module Freyja
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: freyja
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: