Support `limit(n)` and `offset(n)` nodes in dot output
This commit is contained in:
parent
ff1b97ac09
commit
7669dc2196
|
@ -222,7 +222,7 @@ module Arel # :nodoc: all
|
|||
edge("value") { visit o.value }
|
||||
end
|
||||
|
||||
def visit_ActiveRecord_Relation_QueryAttribute(o)
|
||||
def visit_ActiveModel_Attribute(o)
|
||||
edge("value_before_type_cast") { visit o.value_before_type_cast }
|
||||
end
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require_relative "../helper"
|
||||
require "active_model/attribute"
|
||||
|
||||
module Arel
|
||||
module Visitors
|
||||
|
@ -78,6 +79,12 @@ module Arel
|
|||
collector = Collectors::PlainString.new
|
||||
assert_match '[label="<f0>Arel::Nodes::BindParam"]', @visitor.accept(node, collector).value
|
||||
end
|
||||
|
||||
def test_ActiveModel_Attribute
|
||||
node = ActiveModel::Attribute.with_cast_value("LIMIT", 1, nil)
|
||||
collector = Collectors::PlainString.new
|
||||
assert_match '[label="<f0>ActiveModel::Attribute::WithCastValue"]', @visitor.accept(node, collector).value
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue