module SeedingUtils
Constants
- VERSION
Public Instance Methods
connect(callable)
click to toggle source
Expects a proc that when called, returns a raw PG connection. For example:
SeedingUtils.connection = -> {ActiveRecord::Base.connection.raw_connection}
or:
SeedingUtils.connection = -> {PG::Connection.open dbname: 'foo'}
# File lib/seeding_utils.rb, line 14 def connect(callable) @connection_callable = callable end
connection()
click to toggle source
@return PG::Connection
# File lib/seeding_utils.rb, line 19 def connection @connection_callable.call end