Error using Easy Gantt Pro Plugin installed with Microsoft SQL Server database

Added by Renato Santos de Souza about 1 year ago

We are facing an error using Easy Gantt Pro Redmine Plugin ( installed with Microsoft SQL Server database.

The application log reports:

NoMethodError (undefined method `-' for "2014-07-07":String):
  plugins/easy_gantt/app/controllers/easy_gantt_controller.rb:223:in `build_dates'
  plugins/easy_gantt/app/controllers/easy_gantt_controller.rb:38:in `projects'
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'

This is occurring due to the statement "(starts.min || ends.min ||" form method "build_dates" (see code below) is returning a string type and expected should be date type (then substract 1 day from this value).

    def build_dates(data, starts, ends)
      starts =
      ends =

      @start_date = (starts.min || ends.min || -
      @end_date = (ends.max || starts.max || +

The problem is probably related with the the database adaptor to SQL Server database. We are using the following ruby gems to access database: "tiny_tds" (0.6.3.rc2) and "activerecord-sqlserver-adapter" (4.2.18). Also using SQL Server client "freetds" (0.91-6).