diff --git a/HISTORY.md b/HISTORY.md index 356e3cb..e33b2a9 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -6,7 +6,7 @@ v1.4.0 ------ * rename model_name to model_class_name for rails 4.2 compatibility - + to update, you must generate and run the migration bundle exec rails generate reportable_model_name_migration @@ -51,4 +51,4 @@ v1.0.1 v1.0.0 ------ -* Initial release of the new Reportable gem (formerly known as the ReportsAsSparkline plugin) \ No newline at end of file +* Initial release of the new Reportable gem (formerly known as the ReportsAsSparkline plugin) diff --git a/README.md b/README.md index 4bbc386..a1f004b 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,6 @@ Reportable Reportable allows for the easy creation of reports based on `ActiveRecord` models. - Usage ----- diff --git a/lib/saulabs/reportable/report_cache.rb b/lib/saulabs/reportable/report_cache.rb index 36bb5fc..012382f 100644 --- a/lib/saulabs/reportable/report_cache.rb +++ b/lib/saulabs/reportable/report_cache.rb @@ -86,7 +86,7 @@ def self.process(report, options, &block) def self.prepare_result(new_data, cached_data, report, options) new_data = new_data.to_a.map { |data| [ReportingPeriod.from_db_string(options[:grouping], data[0]), data[1]] } - cached_data.to_a.map! { |cached| [ReportingPeriod.new(options[:grouping], cached.reporting_period), cached.value] } + cached_data = cached_data.to_a.map { |cached| [ReportingPeriod.new(options[:grouping], cached.reporting_period), cached.value] } current_reporting_period = ReportingPeriod.new(options[:grouping]) reporting_period = get_first_reporting_period(options) result = []