lib/chartjs/engine.rb in chartjs-ror-2.2.0 vs lib/chartjs/engine.rb in chartjs-ror-3.0.0
- old
+ new
@@ -1,20 +1,13 @@
require 'chartjs/chart_helpers'
-require 'chartjs/axis_helpers'
module Chartjs
class Engine < Rails::Engine
initializer 'chartjs.chart_helpers' do
- ActionView::Base.send :include, Chartjs::ChartHelpers
-
- unless ::Chartjs.no_conflict
- ActionView::Base.class_eval do
- %w[ line bar radar polar_area pie doughnut ].each do |type|
- alias :"#{type}_chart" :"chartjs_#{type}_chart"
- end
- end
+ if ::Chartjs.no_conflict
+ ActionView::Base.send :include, Chartjs::ChartHelpers::Explicit
+ else
+ ActionView::Base.send :include, Chartjs::ChartHelpers::Implicit
end
-
- ActionView::Base.send :include, Chartjs::AxisHelpers
end
end
end