File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ def exposures
118118 # representation, this is where you can trigger things from conditional options
119119 # etc.
120120 def serializable_hash ( runtime_options = { } )
121- opts = options . merge ( runtime_options )
121+ opts = options . merge ( runtime_options || { } )
122122 exposures . inject ( { } ) do |output , ( attribute , exposure_options ) |
123123 output [ key_for ( attribute ) ] = value_for ( attribute , opts ) if conditions_met? ( exposure_options , opts )
124124 output
Original file line number Diff line number Diff line change 8787 subject { fresh_class . new ( model ) }
8888
8989 describe '#serializable_hash' do
90+ it 'should not throw an exception if a nil options object is passed' do
91+ expect { fresh_class . new ( model ) . serializable_hash ( nil ) } . not_to raise_error
92+ end
9093 end
9194
9295 describe '#value_for' do
You can’t perform that action at this time.
0 commit comments