seed_reaper 0.0.7 → 0.0.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8c773e91b80565a52fcb3d9db04bbf20c388eb94d4c2b50d82cc5039a93f0c2b
4
- data.tar.gz: af0b15bec5a9fdab53d79db47f00396a543e61cf656eae6f379f2cf3a871bac6
3
+ metadata.gz: 338334877dd8903cc4383daa7a0ba5145b03d826e34caadb895d2dd7315ad6e5
4
+ data.tar.gz: 852714966712a98fe5787bc2b217f2ec83213a95d55c6ab07ba6d73d0d252f14
5
5
  SHA512:
6
- metadata.gz: '012080a2a7cc080d9e555bf60857a2e64ae5349d24bdd680ec2f004741801afd2363db99e52446df6d6cb03e2c4d0f79ce4c2131a1247ecd4a083bf2b0e4ecbf'
7
- data.tar.gz: 665f2d89354342054b06443fca9165c73e142d61b05c93114980a23362d79e0c137214572e46e07105cc0c36a7e8d5bb716825d0c806cdf34d1d93e2ec9d8249
6
+ metadata.gz: 343b4809b733469b8efbe44a013e33d02ef69e51473b908e339577c68df7e64db4569123a87f768e291470e9d97e0814e78c5b283dc0ce86ef09328e1f6810fe
7
+ data.tar.gz: 5d92b810c6b1c7dadfc24ee5d184676871b93f16b9a84c363e90206593e5f3c62b1f4f04eeb2ac1bedbc56f33142d64d3a749e81db6a495fe34fbd865c9f26d9
@@ -40,7 +40,7 @@ module SeedReaper
40
40
  return schema unless instance._reflections[schema.to_s].belongs_to?
41
41
  end
42
42
 
43
- %i[count joins nullify].each do |meta_field|
43
+ %i[count joins nullify class_name].each do |meta_field|
44
44
  define_method meta_field do
45
45
  meta(meta_field)
46
46
  end
@@ -20,7 +20,7 @@ module SeedReaper
20
20
  def base_model
21
21
  return @config.to_s.camelize.constantize if @config.is_a?(Symbol)
22
22
 
23
- @config.first[0].to_s.camelize.constantize
23
+ (base_config_evaluator.class_name || @config.first[0]).to_s.camelize.constantize
24
24
  end
25
25
 
26
26
  def base_config
@@ -29,6 +29,10 @@ module SeedReaper
29
29
  @config.first[1]
30
30
  end
31
31
 
32
+ def base_config_evaluator
33
+ @base_config_evaluator ||= ConfigEvaluator.new(base_config)
34
+ end
35
+
32
36
  def seedify_collection(collection, config)
33
37
  ce = ConfigEvaluator.new(config)
34
38
  evaluated_collection(collection, ce).reduce('') do |str, instance|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SeedReaper
4
- VERSION = '0.0.7'
4
+ VERSION = '0.0.8'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seed_reaper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Butts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-25 00:00:00.000000000 Z
11
+ date: 2022-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport