Use condition_type in case statement for included?.

This commit is contained in:
Chris Nixon 2016-01-09 16:32:17 -08:00 committed by Lucas Hosseini
parent 40ed7b57bd
commit 7fbf7e536d

View File

@ -25,7 +25,7 @@ module ActiveModel
# @api private
#
def included?(serializer)
case condition
case condition_type
when :if
serializer.public_send(condition)
when :unless
@ -38,6 +38,7 @@ module ActiveModel
private
def condition_type
@condition_type ||=
if options.key?(:if)
:if
elsif options.key?(:unless)