You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mastodon/app/models/concerns/database_view_record.rb

26 lines
474 B
Ruby

# frozen_string_literal: true
module DatabaseViewRecord
extend ActiveSupport::Concern
class_methods do
def refresh
Scenic.database.refresh_materialized_view(
table_name,
concurrently: true,
cascade: false
)
rescue ActiveRecord::StatementInvalid
Scenic.database.refresh_materialized_view(
table_name,
concurrently: false,
cascade: false
)
end
end
def readonly?
true
end
end