Skip to content

Commit 23164cb

Browse files
committed
fix method call
1 parent fe45ac3 commit 23164cb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/ajax-datatables-rails/base.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,12 @@ def search_condition(column, value)
112112
# if :pg
113113
# elsif :mysql
114114
# else
115-
if @config.db_adapter == :pg
116-
casted_column = ::Arel::Nodes::NamedFunction.new('CAST', [model.arel_table[column.to_sym].as('VARCHAR')])
115+
if config.db_adapter == :pg
116+
typecast = 'VARCHAR'
117117
else
118-
casted_column = ::Arel::Nodes::NamedFunction.new('CAST', [model.arel_table[column.to_sym].as('CHAR')])
118+
typecase = 'CHAR'
119119
end
120+
casted_column = ::Arel::Nodes::NamedFunction.new('CAST', [model.arel_table[column.to_sym].as(typecast)])
120121
casted_column.matches("%#{value}%")
121122
end
122123

0 commit comments

Comments
 (0)