lib/alba/association.rb in alba-2.2.0 vs lib/alba/association.rb in alba-2.3.0
- old
+ new
@@ -30,10 +30,10 @@
# @param target [Object] the object having an association method
# @param within [Hash] determines what associations to be serialized. If not set, it serializes all associations.
# @param params [Hash] user-given Hash for arbitrary data
# @return [Hash]
def to_h(target, within: nil, params: {})
- params = params.merge(@params) unless @params.empty?
+ params = params.merge(@params)
@object = target.__send__(@name)
@object = @condition.call(object, params, target) if @condition
return if @object.nil?
if @resource.is_a?(Proc)