Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@nglx
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nglx/c54d96e0708f4c614640 to your computer and use it in GitHub Desktop.
Save nglx/c54d96e0708f4c614640 to your computer and use it in GitHub Desktop.
Reusing sequel-rails connection in rom-yesql
ROM::Yesql::Repository.class_eval do
def initialize(uri, options = {})
super
@connection = Sequel::Model.db
initialize_queries
ROM::Yesql::Relation.query_proc(query_proc)
ROM::Yesql::Relation.load_queries(queries)
end
end
@nglx
Copy link
Author

nglx commented Apr 2, 2015

I know I shouldn't monkey patch that 😀

@solnic
Copy link

solnic commented Apr 2, 2015

We have an interface in rom-sql that allows you to inject existing connection - we should add that to rom-yesql too :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment