Method: Faker::Webhookdb.pg_connection

Defined in:
lib/webhookdb/fixtures/faker.rb

.pg_connection(user: nil, password: nil, host: nil, port: nil, dbname: nil) ⇒ Object



32
33
34
35
36
37
38
39
# File 'lib/webhookdb/fixtures/faker.rb', line 32

def pg_connection(user: nil, password: nil, host: nil, port: nil, dbname: nil)
  user ||= Faker::Internet.username
  password ||= Faker::Internet.password
  host ||= Faker::Internet.ip_v4_address
  port ||= Faker::Number.between(from: 2000, to: 50_000)
  dbname ||= Faker::Lorem.word
  return "postgres://#{user}:#{password}@#{host}:#{port}/#{dbname}"
end