pragma-decorator 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e8cbfb161f363349668460111a7fb2f5936b400a
4
- data.tar.gz: 1e49a4456a7d4aaf2a01d217f3fb52538e49fa86
3
+ metadata.gz: 1d247ca8e236d5a993b70a518c5f64fc82e9ed80
4
+ data.tar.gz: 145c3dbf948aa6bbc8e2d63b2e49126778d417b7
5
5
  SHA512:
6
- metadata.gz: ff52579a206fea38b5333c74b84589a579c5b1d0886f633848635fc61a28f6f178176ac609c7a0a53bff1683e173b6652a4628d54c767a3a86be00abbb763f37
7
- data.tar.gz: 666eb32eb1ba858e3659ee403af8a40432ef623292f2a7e3ff0fc53ee2c9a023f0256f3ee30043d33c3d346c971c384751a798b124656adf27ed422e10e41815
6
+ metadata.gz: 55cb0eacc764ba44011b43c0bb9e1203202dc43d7b395379bf016295ba0a268e0c1dcacfe268dd8238d452cd6dbc5d210bec792fb7a1d6dad3d89c9a7ac32ab7
7
+ data.tar.gz: 105d6b13dbcfa5e31943739840e73c39a0aca84da28a4d248cc97d760f160458fc313d354e7d236b98c44a59017bd3af2428a0868e164d90de1f7f703dc31199
@@ -55,7 +55,7 @@ module Pragma
55
55
  #
56
56
  # @return [String]
57
57
  def unexpanded_value
58
- if decorator_context? || model_reflection.nil?
58
+ if decorator_context? || model_reflection.nil? || !reflection.options[:optimize]
59
59
  return associated_object&.public_send(associated_object.class.primary_key)
60
60
  end
61
61
 
@@ -52,6 +52,7 @@ module Pragma
52
52
  expandable: false,
53
53
  render_nil: false,
54
54
  exec_context: :decorated,
55
+ optimize: true,
55
56
  }.merge(options).tap do |opts|
56
57
  opts[:exec_context] = opts[:exec_context].to_sym
57
58
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Pragma
4
4
  module Decorator
5
- VERSION = '1.2.0'
5
+ VERSION = '1.3.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pragma-decorator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alessandro Desantis
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-05 00:00:00.000000000 Z
11
+ date: 2018-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json