Module: Octoshark::ActiveRecordAbstractAdapter

Defined in:
lib/octoshark/active_record_extensions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#connection_nameObject

Returns the value of attribute connection_name.



27
28
29
# File 'lib/octoshark/active_record_extensions.rb', line 27

def connection_name
  @connection_name
end

#database_nameObject

Returns the value of attribute database_name.



27
28
29
# File 'lib/octoshark/active_record_extensions.rb', line 27

def database_name
  @database_name
end

Instance Method Details

#log(sql, name = "SQL", *other_args, &block) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/octoshark/active_record_extensions.rb', line 29

def log(sql, name = "SQL", *other_args, &block)
  if connection_name || database_name
    name = "[Octoshark: #{[connection_name, database_name].compact.join(' ')}] #{name}"
  end

  super(sql, name, *other_args, &block)
end