Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix for ruby 2.3.1 #42

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -51,4 +51,4 @@ v1.0.1
v1.0.0
------

* Initial release of the new Reportable gem (formerly known as the ReportsAsSparkline plugin)
* Initial release of the new Reportable gem (formerly known as the ReportsAsSparkline plugin)
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Reportable

Reportable allows for the easy creation of reports based on `ActiveRecord` models.


Usage
-----

Expand Down
2 changes: 1 addition & 1 deletion lib/saulabs/reportable/report_cache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down