Class: Scenic::Adapters::Postgres::RefreshDependencies

Inherits:
Object
  • Object
show all
Defined in:
lib/scenic/adapters/postgres/refresh_dependencies.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, adapter, connection, concurrently:) ⇒ RefreshDependencies

Returns a new instance of RefreshDependencies.


9
10
11
12
13
14
# File 'lib/scenic/adapters/postgres/refresh_dependencies.rb', line 9

def initialize(name, adapter, connection, concurrently:)
  @name = name
  @adapter = adapter
  @connection = connection
  @concurrently = concurrently
end

Class Method Details

.call(name, adapter, connection, concurrently: false) ⇒ Object


5
6
7
# File 'lib/scenic/adapters/postgres/refresh_dependencies.rb', line 5

def self.call(name, adapter, connection, concurrently: false)
  new(name, adapter, connection, concurrently: concurrently).call
end

Instance Method Details

#callObject


16
17
18
19
20
21
22
23
# File 'lib/scenic/adapters/postgres/refresh_dependencies.rb', line 16

def call
  dependencies.each do |dependency|
    adapter.refresh_materialized_view(
      dependency,
      concurrently: concurrently,
    )
  end
end