| renamed report_as_sparkline to reportS_as_sparkline - reportable - Fork of repo… | |
| Log | |
| Files | |
| Refs | |
| README | |
| --- | |
| commit a1b33b983903c7e5fa26c10953ea98b4996348bb | |
| parent 3ebb3b9e324bd9dde944cd37855be48c8801e9b6 | |
| Author: Marco Otte-Witte <[email protected]> | |
| Date: Tue, 13 Jan 2009 01:29:11 +0800 | |
| renamed report_as_sparkline to reportS_as_sparkline | |
| Signed-off-by: Marco Otte-Witte <[email protected]> | |
| Diffstat: | |
| M lib/kvlr/reports_as_sparkline.rb | 14 +++++++------- | |
| M lib/kvlr/reports_as_sparkline/repo… | 4 ++-- | |
| M spec/models/report_method_spec.rb | 2 +- | |
| 3 files changed, 10 insertions(+), 10 deletions(-) | |
| --- | |
| diff --git a/lib/kvlr/reports_as_sparkline.rb b/lib/kvlr/reports_as_sparkline.rb | |
| @@ -26,16 +26,16 @@ module Kvlr #:nodoc: | |
| # ==== Examples | |
| # | |
| # class Game < ActiveRecord::Base | |
| - # report_as_sparkline :games_per_day | |
| - # report_as_sparkline :games_played_total, :cumulate => true | |
| + # reports_as_sparkline :games_per_day | |
| + # reports_as_sparkline :games_played_total, :cumulate => true | |
| # end | |
| # class User < ActiveRecord::Base | |
| - # report_as_sparkline :registrations, :operation => :count | |
| - # report_as_sparkline :activations, :date_column_name => :activated_a… | |
| - # report_as_sparkline :total_users_report, :cumulate => true | |
| - # report_as_sparkline :rake, :aggregation => :sum, :value_column_name… | |
| + # reports_as_sparkline :registrations, :operation => :count | |
| + # reports_as_sparkline :activations, :date_column_name => :activated_… | |
| + # reports_as_sparkline :total_users_report, :cumulate => true | |
| + # reports_as_sparkline :rake, :aggregation => :sum, :value_column_nam… | |
| # end | |
| - def report_as_sparkline(name, options = {}) | |
| + def reports_as_sparkline(name, options = {}) | |
| (class << self; self; end).instance_eval do | |
| define_method "#{name.to_s}_report".to_sym do |*args| | |
| if options.delete(:cumulate) | |
| diff --git a/lib/kvlr/reports_as_sparkline/report.rb b/lib/kvlr/reports_as_spar… | |
| @@ -8,8 +8,8 @@ module Kvlr #:nodoc: | |
| attr_reader :klass, :name, :date_column_name, :value_column_name, :group… | |
| # ==== Parameters | |
| - # * <tt>klass</tt> - The model the report works on (This is the class yo… | |
| - # * <tt>name</tt> - The name of the report (as in Kvlr::ReportsAsSparkli… | |
| + # * <tt>klass</tt> - The model the report works on (This is the class yo… | |
| + # * <tt>name</tt> - The name of the report (as in Kvlr::ReportsAsSparkli… | |
| # | |
| # ==== Options | |
| # | |
| diff --git a/spec/models/report_method_spec.rb b/spec/models/report_method_spec… | |
| @@ -39,7 +39,7 @@ describe Kvlr::ReportsAsSparkline do | |
| end | |
| class User < ActiveRecord::Base | |
| - report_as_sparkline :registrations, :limit => 10 | |
| + reports_as_sparkline :registrations, :limit => 10 | |
| end | |
| class SpecialUser < User; end |