Class: AMEE::Rails::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/amee/rails.rb

Class Method Summary collapse

Class Method Details

.global(options = {}) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/amee/rails.rb', line 9

def self.global(options = {})
  unless @connection
    $AMEE_CONFIG ||= {} # Make default values nil
    if $AMEE_CONFIG['ssl'] == false
      options.merge! :ssl => false
    end
    @connection = self.connect($AMEE_CONFIG['server'], $AMEE_CONFIG['username'], $AMEE_CONFIG['password'], options)
    # Also store as $amee for backwards compatibility, though this is now deprecated
    $amee = @connection
  end
  @connection
end