Skip to content

Commit d8c34b5

Browse files
author
Nicolas Rodriguez
committed
Update the default db_adapter to :postgresql like Rails (instead of :pg)
This is backward compatible
1 parent 3b5c3b9 commit d8c34b5

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

lib/ajax-datatables-rails/config.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module AjaxDatatablesRails
44

55
# configure AjaxDatatablesRails global settings
66
# AjaxDatatablesRails.configure do |config|
7-
# config.db_adapter = :pg
7+
# config.db_adapter = :postgresql
88
# end
99
def self.configure
1010
yield @config ||= AjaxDatatablesRails::Configuration.new
@@ -19,6 +19,6 @@ class Configuration
1919
include ActiveSupport::Configurable
2020

2121
config_accessor(:orm) { :active_record }
22-
config_accessor(:db_adapter) { :pg }
22+
config_accessor(:db_adapter) { :postgresql }
2323
end
2424
end

spec/ajax-datatables-rails/configuration_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
expect(config.orm).to eq(:active_record)
2525
end
2626

27-
it 'default db_adapter should :pg (postgresql)' do
28-
expect(config.db_adapter).to eq(:pg)
27+
it 'default db_adapter should :postgresql' do
28+
expect(config.db_adapter).to eq(:postgresql)
2929
end
3030
end
3131

spec/ajax-datatables-rails/orm/active_record_filter_records_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@
127127
expect(column.send(:typecast)).to eq('VARCHAR')
128128
end
129129

130+
it 'returns VARCHAR if :db_adapter is :postgre' do
131+
allow_any_instance_of(AjaxDatatablesRails::Configuration).to receive(:db_adapter) { :postgresql }
132+
expect(column.send(:typecast)).to eq('VARCHAR')
133+
end
134+
130135
it 'returns CHAR if :db_adapter is :mysql2' do
131136
allow_any_instance_of(AjaxDatatablesRails::Configuration).to receive(:db_adapter) { :mysql2 }
132137
expect(column.send(:typecast)).to eq('CHAR')

0 commit comments

Comments
 (0)