app/models/smithy/assets_datatable.rb in smithycms-0.6.3 vs app/models/smithy/assets_datatable.rb in smithycms-0.6.4

- old
+ new

@@ -61,11 +61,11 @@ def fetch_assets assets = Asset.unscoped.order("#{sort_column} #{sort_direction}") assets = assets.page(page).per(per_page) # TODO: need to check for regex flag if params[:search][:value].present? - assets = assets.where("name like :search or content_type like :search", search: "%#{params[:search][:value]}%") + assets = assets.where("LOWER(name) LIKE LOWER(:search) or LOWER(content_type) LIKE LOWER(:search)", search: "%#{params[:search][:value]}%") end assets end def page @@ -87,6 +87,6 @@ def sort_direction params[:order][:"0"][:dir] == "desc" ? "desc" : "asc" end end -end \ No newline at end of file +end