lib/nobrainer.rb
# Note: we always access the connection explicitly, so that in the future,
# we can refactor to return a connection depending on the context.
# Note that a connection is tied to a database in NoBrainer.
we always access the connection explicitly, so that in the future,
we can refactor to return a connection depending on the context.
Note that a connection is tied to a database in NoBrainer.
we always access the connection explicitly so that in the future we can refactor to return a connection depending on the context . Note that a connection is tied to a database in NoBrainer .
def connection
      @connection ||= begin
        url = NoBrainer::Config.rethinkdb_url
        raise "Please specify a database connection to RethinkDB" unless url
        Connection.new(url).tap { |c| c.connect }
      end
    end
def connection @connection ||= begin url = NoBrainer :: Config . rethinkdb_url raise "Please specify a database connection to RethinkDB" unless url Connection . new ( url ) . tap { | c | c . connect } end end
Note: we always access the connection explicitly, so that in the future,
we can refactor to return a connection depending on the context.
Note : we always access the connection explicitly so that in the future we can refactor to return a connection depending on the context .