easy_export 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 26923115a36ae27bbeb2f8a0d6ed4e8b254985fa
4
- data.tar.gz: f37ee855a1a1449e06bdb6851bd29543b413fd26
3
+ metadata.gz: bbaee8d685b506544035a5b9c272d9bb7aa0f7d9
4
+ data.tar.gz: 975e4672bf6f23362a728a5e49164541c1a155de
5
5
  SHA512:
6
- metadata.gz: be319ae1ac2502fb85aabd908716e5ff1e46e257f64e82c2247e39651bc4df030dab09ff82460c3b5f64d6a4d0d52974d29399ea98df45990a5bd006bad10724
7
- data.tar.gz: 3559473809a2048f486422b1651799c916ea98243a13aabe3bf36e635fafac2cb134e937c93fe7a79b4ca78516d1f09c8082b0d25438b408c09404acb2e664bf
6
+ metadata.gz: 8f89eccdbffcf9a3ecaacf5af445f771079a201ab2a72b2e6c239f390f8dc6e797eed757d79f4b544c9d64f14365c79535b00552e66442af1e43f603e1f58876
7
+ data.tar.gz: c60a8f50541af4539dbd1ec140943a33acf04c786bf12f3b03807f6f60bcfbd7ce514556aae190411d6844d0005c402884d4296a2aaad1de92c5cf1e5c6bddd9
@@ -34,6 +34,7 @@ module EasyExport
34
34
  def export_fields; @export_config.fields end
35
35
  end
36
36
 
37
+ # These are the DSL methods available within the `exportable` block
37
38
  class ExportConfig
38
39
  attr_accessor :partial
39
40
 
@@ -80,8 +81,10 @@ module EasyExport
80
81
  def initialize(options = {})
81
82
  @options = options
82
83
  @model = options[:model].constantize
83
- @scope = @model.export_scope
84
- @fields = @model.export_fields
84
+ # the @model.export_scope is configured via the `exportable` block
85
+ @scope = options.fetch :scope, @model.export_scope
86
+ # the fields configured via the `exportable` block
87
+ @fields = options.fetch :fields, @model.export_fields
85
88
  @header = @fields.keys
86
89
  end
87
90
 
@@ -1,3 +1,3 @@
1
1
  module EasyExport
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_export
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Diego Salazar