Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
module ActiveRecord
module ConnectionAdapters
module PostgreSQL
module SchemaStatements
alias_method :old_schema_search_path=, :schema_search_path=
alias_method :old_schema_search_path, :schema_search_path
def schema_search_path=(schema_csv)
unless schema_search_path == schema_csv
self.old_schema_search_path = schema_csv
(Thread.current[:schema_search_path_caches] ||= {})[object_id] = schema_csv
end
end
def schema_search_path
caches = Thread.current[:schema_search_path_caches] ||= {}
caches[object_id] ||= old_schema_search_path
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.