 Error using Easy Gantt Pro Plugin installed with Microsoft SQL Server database
Error using Easy Gantt Pro Plugin installed with Microsoft SQL Server database
Added by Renato Santos de Souza over 8 years ago
We are facing an error using Easy Gantt Pro Redmine Plugin (https://www.redmine.org/plugins/easy-gantt) 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 || Date.today)" 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 = data.map(&starts).compact
      ends = data.map(&ends).compact
      @start_date = (starts.min || ends.min || Date.today) - 1.day
      @end_date = (ends.max || starts.max || Date.today) + 1.day
    end
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).