fixturex 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/fixturex/fixture_location.rb +1 -1
- data/lib/fixturex/tree_builder.rb +5 -1
- data/lib/fixturex/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 517987007a6e6ca80e06f5f2159c45ebdd81e6824c223219cfd55f6a1a07ebec
|
4
|
+
data.tar.gz: 0ae40367ec829d9adb8292ad32d61da2344c3afd8928696298764f33a219368e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 165341e0beb555401e373a8c3314cfd5bfd5020aaf4cab69ed27726a8ee1aa2ce73bbdc98b6235c8d428e1fb70b8dd382a0e0b3f832fefc1005d3c2db714ed6e
|
7
|
+
data.tar.gz: 00a86359a92354f61caeacf69cdc1b7cccc800df9141a27aed9903d83152555824b60a76c77b3b7ec28bc25e0c0d4603bcef4534485255244dcdf338576e27e1
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Fixturex [![Ruby](https://github.com/artemave/fixturex/actions/workflows/ruby.yml/badge.svg)](https://github.com/artemave/fixturex/actions/workflows/ruby.yml)
|
1
|
+
# Fixturex [![Ruby](https://github.com/artemave/fixturex/actions/workflows/ruby.yml/badge.svg)](https://github.com/artemave/fixturex/actions/workflows/ruby.yml) [![Gem Version](https://badge.fury.io/rb/fixturex.svg)](https://badge.fury.io/rb/fixturex)
|
2
2
|
|
3
3
|
Rails fixtures explorer.
|
4
4
|
|
@@ -55,6 +55,10 @@ module Fixturex
|
|
55
55
|
end
|
56
56
|
|
57
57
|
class TreeBuilder
|
58
|
+
def self.cache
|
59
|
+
@cache ||= {}
|
60
|
+
end
|
61
|
+
|
58
62
|
def build_dependency_tree(fixture_path, fixture_name)
|
59
63
|
TreeEntry.new(
|
60
64
|
FixtureLocation.new(fixture_path, fixture_name),
|
@@ -67,7 +71,7 @@ module Fixturex
|
|
67
71
|
def nested_fixtures_locations(parent_fixture_model_class, parent_fixture_name)
|
68
72
|
associations_for_nested_models(parent_fixture_model_class).each_with_object([]) do |association, acc|
|
69
73
|
belongs_to_attribute = belongs_to_attribute_for_association(association)
|
70
|
-
model_fixtures = ModelFixtures.load(association.class_name)
|
74
|
+
model_fixtures = self.class.cache[association.class_name] ||= ModelFixtures.load(association.class_name)
|
71
75
|
|
72
76
|
model_fixtures.each do |fixture|
|
73
77
|
next if fixture.attributes.fetch(belongs_to_attribute, '').to_s.sub(/ .*/, '') != parent_fixture_name
|
data/lib/fixturex/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fixturex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- artemave
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|