Module: JdbcSpec::FoxPro

Defined in:
lib/active_record/connection_adapters/jdbcdbf_adapter.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.adapter_matcher(name) ⇒ Object



24
25
26
# File 'lib/active_record/connection_adapters/jdbcdbf_adapter.rb', line 24

def self.adapter_matcher(name, *)
  name =~ /dbf/i ? self : false
end

Instance Method Details

#add_limit_offset!(sql, options) ⇒ Object



27
28
29
30
31
32
33
# File 'lib/active_record/connection_adapters/jdbcdbf_adapter.rb', line 27

def add_limit_offset!(sql, options)
  if options[:limit]
    find_select = /\b(SELECT(?:\s+DISTINCT)?)\b(.*)/i
    whole, select, rest = find_select.match(sql).to_a
    sql.replace "#{select} TOP #{options[:limit]} #{rest}"
  end
end

#columns(table_name, name = nil) ⇒ Object



34
35
36
37
# File 'lib/active_record/connection_adapters/jdbcdbf_adapter.rb', line 34

def columns(table_name, name = nil)
  columns = super
  downcase_columns columns
end

#quoted_date(value) ⇒ Object



45
# File 'lib/active_record/connection_adapters/jdbcdbf_adapter.rb', line 45

def quoted_date(value); "#{value.strftime("%Y-%m-%d")}"; end

#quoted_falseObject



43
# File 'lib/active_record/connection_adapters/jdbcdbf_adapter.rb', line 43

def quoted_false; 'false'; end

#quoted_trueObject



42
# File 'lib/active_record/connection_adapters/jdbcdbf_adapter.rb', line 42

def quoted_true; 'true'; end

#select(sql, name = nil) ⇒ Object



38
39
40
41
# File 'lib/active_record/connection_adapters/jdbcdbf_adapter.rb', line 38

def select(sql, name=nil)
  rows = super sql, name      
  downcase_rows rows
end

#supports_migrations?Boolean

Returns:

  • (Boolean)


44
# File 'lib/active_record/connection_adapters/jdbcdbf_adapter.rb', line 44

def supports_migrations?; false; end