activekit 0.5.0.dev4 → 0.5.0.dev5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_kit/export/exporter.rb +5 -7
- data/lib/active_kit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '068662b0f0144c92e082fc2a3e5002695a090dc1a4547a79889a945e739b7593'
|
4
|
+
data.tar.gz: a782fef4b69dfd9df1869c78e5826c8699adaf5339ca066ca48531ba391f66c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0b3d0c3bd09b6d4de855c802ca0e4e47485a3fa727331088ff9b0ed3f21bf701485f6f15addd0d4b16cabad7442cb5d8d3f256e5b9d524ea36a0c0b2e58ce70
|
7
|
+
data.tar.gz: 6d74e3e1775bd54f86022f40815593f3e0c60d6fdbb3fed1d14054c633f4af2b1456d1ad03018aaf2b9698fd0aadc123c3884edcd996af3f1ad7405238dcc5aa
|
@@ -13,7 +13,8 @@ module ActiveKit
|
|
13
13
|
unless find_describer_by(describer_name: name)
|
14
14
|
options.store(:attributes, {})
|
15
15
|
@describers.store(name, options)
|
16
|
-
|
16
|
+
describer = find_describer_by(describer_name: name)
|
17
|
+
define_describer_method(describer)
|
17
18
|
end
|
18
19
|
end
|
19
20
|
|
@@ -34,14 +35,11 @@ module ActiveKit
|
|
34
35
|
|
35
36
|
private
|
36
37
|
|
37
|
-
def define_describer_method(
|
38
|
-
case kind
|
38
|
+
def define_describer_method(describer)
|
39
|
+
case describer.kind
|
39
40
|
when :csv
|
40
41
|
@current_class.class_eval do
|
41
|
-
define_singleton_method name do
|
42
|
-
describer = exporter.find_describer_by(describer_name: name)
|
43
|
-
raise "could not find describer for the describer name '#{name}'" unless describer.present?
|
44
|
-
|
42
|
+
define_singleton_method describer.name do
|
45
43
|
# The 'all' relation must be captured outside the Enumerator,
|
46
44
|
# else it will get reset to all the records of the class.
|
47
45
|
all_activerecord_relation = all.includes(describer.includes)
|
data/lib/active_kit/version.rb
CHANGED