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

Inherits:
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 OperationTreeBuilders::Array

#call

Methods inherited from OperationTreeBuilders::Base

#call

Constructor Details

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

Returns a new instance of ActiveRecordRelation.



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

def initialize(actual:, **rest)
  super

  @actual = actual.to_a
end

Class Method Details

.applies_to?(expected, actual) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/super_diff/active_record/operation_tree_builders/active_record_relation.rb', line 5

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