diff --git a/Gemfile b/Gemfile index 01c2cfd7..e1ed43a7 100644 --- a/Gemfile +++ b/Gemfile @@ -23,7 +23,7 @@ gem 'bootsnap', require: false gem 'mysql2' gem 'prawn' gem 'prawn-table' -gem 'haml' +gem 'haml', '~> 5.0' gem 'haml-rails' gem 'kaminari' gem 'simple_form' diff --git a/Gemfile.lock b/Gemfile.lock index 5b1a9fe7..a07ffe93 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -234,9 +234,8 @@ GEM rails (>= 4.0.0) globalid (1.0.0) activesupport (>= 5.0) - haml (6.1.1) - temple (>= 0.8.2) - thor + haml (5.2.2) + temple (>= 0.8.0) tilt haml-rails (2.1.0) actionpack (>= 5.1) @@ -546,7 +545,7 @@ GEM sqlite3-ruby (1.3.3) sqlite3 (>= 1.3.3) table_print (1.5.7) - temple (0.9.1) + temple (0.10.0) terser (1.1.13) execjs (>= 0.3.0, < 3) therubyracer (0.12.3) @@ -625,7 +624,7 @@ DEPENDENCIES foodsoft_polls! foodsoft_wiki! gaffe - haml + haml (~> 5.0) haml-rails hashie (~> 3.4.6) i18n-js (~> 3.0.0.rc8) diff --git a/app/controllers/finance/financial_transactions_controller.rb b/app/controllers/finance/financial_transactions_controller.rb index 930acebe..e0c53e19 100644 --- a/app/controllers/finance/financial_transactions_controller.rb +++ b/app/controllers/finance/financial_transactions_controller.rb @@ -18,7 +18,7 @@ class Finance::FinancialTransactionsController < ApplicationController sort = "created_on DESC" end - @q = FinancialTransaction.search(params[:q]) + @q = FinancialTransaction.ransack(params[:q]) @financial_transactions_all = @q.result(distinct: true).includes(:user).order(sort) @financial_transactions_all = @financial_transactions_all.visible unless params[:show_hidden] @financial_transactions_all = @financial_transactions_all.where(ordergroup_id: @ordergroup.id) if @ordergroup diff --git a/app/models/group_order.rb b/app/models/group_order.rb index c789ef4e..f3153c44 100644 --- a/app/models/group_order.rb +++ b/app/models/group_order.rb @@ -32,8 +32,8 @@ class GroupOrder < ApplicationRecord # Generate some data for the javascript methods in ordering view def load_data data = {} - data[:account_balance] = ordergroup.nil? ? BigDecimal.new('+Infinity') : ordergroup.account_balance - data[:available_funds] = ordergroup.nil? ? BigDecimal.new('+Infinity') : ordergroup.get_available_funds(self) + data[:account_balance] = ordergroup.nil? ? BigDecimal('+Infinity') : ordergroup.account_balance + data[:available_funds] = ordergroup.nil? ? BigDecimal('+Infinity') : ordergroup.get_available_funds(self) # load prices and other stuff.... data[:order_articles] = {} diff --git a/config/initializers/extensions.rb b/config/initializers/extensions.rb index 799f52e6..68c7c8f4 100644 --- a/config/initializers/extensions.rb +++ b/config/initializers/extensions.rb @@ -3,7 +3,7 @@ class String # remove comma from decimal inputs def self.delocalized_decimal(string) if !string.blank? and string.is_a?(String) - BigDecimal.new(string.sub(',', '.')) + BigDecimal(string.sub(',', '.')) else string end diff --git a/plugins/current_orders/app/controllers/current_orders/articles_controller.rb b/plugins/current_orders/app/controllers/current_orders/articles_controller.rb index 0e4b7dd9..ef23f332 100644 --- a/plugins/current_orders/app/controllers/current_orders/articles_controller.rb +++ b/plugins/current_orders/app/controllers/current_orders/articles_controller.rb @@ -32,7 +32,7 @@ class CurrentOrders::ArticlesController < ApplicationController else @order_articles = OrderArticle.where(order_id: @current_orders.all.map(&:id)) end - @q = OrderArticle.search(params[:q]) + @q = OrderArticle.ransack(params[:q]) @order_articles = @order_articles.ordered.merge(@q.result).includes(:article, :article_price) @order_article = @order_articles.where(id: params[:id]).first end