rails-excel 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,7 +13,11 @@ module RailsExcel
13
13
  attr_reader :available_strategies
14
14
 
15
15
  def add_strategy(name, instance)
16
- @available_strategies[name.to_sym] = instance
16
+ strategy = instance
17
+ if Class === instance && !instance.respond_to?(:compile)
18
+ strategy = instance.new
19
+ end
20
+ @available_strategies[name.to_sym] = strategy
17
21
  end
18
22
 
19
23
  def configure(&block)
@@ -1,3 +1,3 @@
1
1
  module RailsExcel
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-excel
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 2
9
+ - 3
10
10
  segments_generated: true
11
- version: 1.0.2
11
+ version: 1.0.3
12
12
  platform: ruby
13
13
  authors:
14
14
  - Ramihajamalala Hery