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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eff7a049cd21979e76253d095e0d0ba722b289370a15426cf4b87c922d2bab66
4
- data.tar.gz: 27b310f65547d08961b9044fe43bc606cfb78f0766487052c9488a2fa3e78ed8
3
+ metadata.gz: '068662b0f0144c92e082fc2a3e5002695a090dc1a4547a79889a945e739b7593'
4
+ data.tar.gz: a782fef4b69dfd9df1869c78e5826c8699adaf5339ca066ca48531ba391f66c5
5
5
  SHA512:
6
- metadata.gz: ce4750f37977c8e2a63a6ec85ad4def621877f3789eb64e598d214066f840463c3cbe7a60b5e4853d9a639a2f83cd480a953c0436535547acf8a9b55b5113de9
7
- data.tar.gz: c3813bb2b5df232389c25c8bc0ecf35f5875d6fdc34060d67993643f728bca9c0b6d0d81c85abed349dfb52bef8b0ac2a392ce88ce72a37adc722c3d533e1f64
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
- define_describer_method(kind: options[:kind], name: name)
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(kind:, name:)
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)
@@ -1,3 +1,3 @@
1
1
  module ActiveKit
2
- VERSION = '0.5.0.dev4'
2
+ VERSION = '0.5.0.dev5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activekit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0.dev4
4
+ version: 0.5.0.dev5
5
5
  platform: ruby
6
6
  authors:
7
7
  - plainsource