Class: SuperDiff::ActiveRecord::OperationTreeBuilders::ActiveRecordRelation

Inherits:
Basic::OperationTreeBuilders::Array show all
Defined in:
lib/super_diff/active_record/operation_tree_builders/active_record_relation.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Basic::OperationTreeBuilders::Array

#call

Methods inherited from Core::AbstractOperationTreeBuilder

#call

Constructor Details

#initialize(actual:, **rest) ⇒ ActiveRecordRelation

Returns a new instance of ActiveRecordRelation.



11
12
13
14
15
# File 'lib/super_diff/active_record/operation_tree_builders/active_record_relation.rb', line 11

def initialize(actual:, **rest)
  super

  @actual = actual.to_a
end

Class Method Details

.applies_to?(expected, actual) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/super_diff/active_record/operation_tree_builders/active_record_relation.rb', line 7

def self.applies_to?(expected, actual)
  expected.is_a?(::Array) && actual.is_a?(::ActiveRecord::Relation)
end