easy_export 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/easy_export.rb +5 -2
- data/lib/easy_export/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbaee8d685b506544035a5b9c272d9bb7aa0f7d9
|
4
|
+
data.tar.gz: 975e4672bf6f23362a728a5e49164541c1a155de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f89eccdbffcf9a3ecaacf5af445f771079a201ab2a72b2e6c239f390f8dc6e797eed757d79f4b544c9d64f14365c79535b00552e66442af1e43f603e1f58876
|
7
|
+
data.tar.gz: c60a8f50541af4539dbd1ec140943a33acf04c786bf12f3b03807f6f60bcfbd7ce514556aae190411d6844d0005c402884d4296a2aaad1de92c5cf1e5c6bddd9
|
data/lib/easy_export.rb
CHANGED
@@ -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
|
-
|
84
|
-
@
|
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
|
|
data/lib/easy_export/version.rb
CHANGED