lib/json_builder/member.rb in json_builder-3.0.2 vs lib/json_builder/member.rb in json_builder-3.0.3
- old
+ new
@@ -8,10 +8,10 @@
def initialize(key, scope, *args, &block)
@key = key
argument = args.shift
- if argument.is_a?(Array)
+ if argument.is_a?(Array) || defined?(ActiveRecord::Relation) && argument.is_a?(ActiveRecord::Relation)
@value = Elements.new(scope, argument, &block)
else
@value = Value.new(scope, argument, &block)
end
end
\ No newline at end of file