DEV: Apply syntax_tree formatting to lib/*

This commit is contained in:
David Taylor
2023-01-09 12:10:19 +00:00
parent b0fda61a8e
commit 6417173082
507 changed files with 16550 additions and 12627 deletions

View File

@ -1,16 +1,17 @@
# frozen_string_literal: true
class MiniSqlMultisiteConnection < MiniSql::ActiveRecordPostgres::Connection
class CustomBuilder < MiniSql::Builder
def initialize(connection, sql)
super
end
def secure_category(secure_category_ids, category_alias = 'c')
def secure_category(secure_category_ids, category_alias = "c")
if secure_category_ids.present?
where("NOT COALESCE(#{category_alias}.read_restricted, false) OR #{category_alias}.id in (:secure_category_ids)", secure_category_ids: secure_category_ids)
where(
"NOT COALESCE(#{category_alias}.read_restricted, false) OR #{category_alias}.id in (:secure_category_ids)",
secure_category_ids: secure_category_ids,
)
else
where("NOT COALESCE(#{category_alias}.read_restricted, false)")
end
@ -40,8 +41,10 @@ class MiniSqlMultisiteConnection < MiniSql::ActiveRecordPostgres::Connection
end
end
def before_committed!(*); end
def rolledback!(*); end
def before_committed!(*)
end
def rolledback!(*)
end
def trigger_transactional_callbacks?
true
end
@ -67,9 +70,7 @@ class MiniSqlMultisiteConnection < MiniSql::ActiveRecordPostgres::Connection
def after_commit(&blk)
return blk.call if !transaction_open?
ActiveRecord::Base.connection.add_transaction_record(
AfterCommitWrapper.new(&blk)
)
ActiveRecord::Base.connection.add_transaction_record(AfterCommitWrapper.new(&blk))
end
def self.instance
@ -107,5 +108,4 @@ class MiniSqlMultisiteConnection < MiniSql::ActiveRecordPostgres::Connection
query
end
end
end