Module: Redistat::Database

Included in:
Event, Finder, Key, Label, Model, Scope, Summary
Defined in:
lib/redistat/mixins/database.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



3
4
5
# File 'lib/redistat/mixins/database.rb', line 3

def self.included(base)
  base.extend(Database)
end

Instance Method Details

#db(ref = nil) ⇒ Object



6
7
8
9
# File 'lib/redistat/mixins/database.rb', line 6

def db(ref = nil)
  ref ||= @options[:connection_ref] if !@options.nil?
  Redistat.connection(ref)
end