Module: JdbcSpec::FoxPro
- Defined in:
- lib/active_record/connection_adapters/jdbcdbf_adapter.rb
Class Method Summary collapse
Instance Method Summary collapse
- #add_limit_offset!(sql, options) ⇒ Object
- #columns(table_name, name = nil) ⇒ Object
- #quoted_date(value) ⇒ Object
- #quoted_false ⇒ Object
- #quoted_true ⇒ Object
- #select(sql, name = nil) ⇒ Object
- #supports_migrations? ⇒ Boolean
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, ) if [:limit] find_select = /\b(SELECT(?:\s+DISTINCT)?)\b(.*)/i whole, select, rest = find_select.match(sql).to_a sql.replace "#{select} TOP #{[: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_false ⇒ Object
43 |
# File 'lib/active_record/connection_adapters/jdbcdbf_adapter.rb', line 43 def quoted_false; 'false'; end |
#quoted_true ⇒ Object
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
44 |
# File 'lib/active_record/connection_adapters/jdbcdbf_adapter.rb', line 44 def supports_migrations?; false; end |