dumped_railers 0.1.2 → 0.1.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/CHANGELOG.md +15 -0
- data/lib/dumped_railers/fixture_builder/record.rb +7 -7
- data/lib/dumped_railers/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: 440f4c535538d4dc81d6b117d26c27a9639146776b11fa5358ee90bbd8528b8b
|
|
4
|
+
data.tar.gz: ea53e8c0ca3a4220432bfcf40895e79a5bff18b616965b2627db7f78b73b39b0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 847f16c2456ddd871963feee72a95e57bffac72a63c7c67f714b93dfb7c95698f0ee44f368b0f2166a1a1bd1cc4bd9a4bc3d084fd0fc556c055d233bcc9f67f9
|
|
7
|
+
data.tar.gz: 11e9d92b573fa02f1602af0035d5834648d6893b0b04c6ad64729c6b19504b99ba3ce1bdea7ee9c04a02e2833164a5c1e10e809badd8eacb09f06c35f4eb9c43
|
data/CHANGELOG.md
CHANGED
|
@@ -8,3 +8,18 @@
|
|
|
8
8
|
- Add config options to be able to ignore specific columns
|
|
9
9
|
- Accept preprocessors to make filtering behavior pluggable and customizable
|
|
10
10
|
- Add Readme
|
|
11
|
+
|
|
12
|
+
## [0.1.1]
|
|
13
|
+
### Fixed
|
|
14
|
+
- Fix mis-handling of namespaced class names (separated by `::`)
|
|
15
|
+
|
|
16
|
+
## [0.1.2]
|
|
17
|
+
### Changed
|
|
18
|
+
- Accept wider types of reference labels, allowing spaces in-between (tentative)
|
|
19
|
+
|
|
20
|
+
## [0.1.3]
|
|
21
|
+
### Fixed
|
|
22
|
+
- Cope with relations that has different name with the actual class name
|
|
23
|
+
(e.g. associations defined using `:class_name` and `:foreign_key` options)
|
|
24
|
+
|
|
25
|
+
|
|
@@ -20,18 +20,18 @@ module DumpedRailers
|
|
|
20
20
|
@model.reflect_on_all_associations.select(&:belongs_to?).each do |rel|
|
|
21
21
|
# skip ignorables
|
|
22
22
|
next unless attributes.has_key? rel.foreign_key.to_s
|
|
23
|
-
|
|
23
|
+
|
|
24
24
|
if rel.polymorphic?
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
class_name = attributes[rel.foreign_type.to_s]
|
|
26
|
+
|
|
27
27
|
attributes[rel.name.to_s] = record_label_for(
|
|
28
|
-
|
|
28
|
+
class_name,
|
|
29
29
|
attributes.delete(rel.foreign_key.to_s),
|
|
30
30
|
attributes.delete(rel.foreign_type.to_s)
|
|
31
31
|
)
|
|
32
32
|
else
|
|
33
33
|
attributes[rel.name.to_s] = record_label_for(
|
|
34
|
-
rel.
|
|
34
|
+
rel.class_name,
|
|
35
35
|
attributes.delete(rel.foreign_key.to_s)
|
|
36
36
|
)
|
|
37
37
|
end
|
|
@@ -42,10 +42,10 @@ module DumpedRailers
|
|
|
42
42
|
|
|
43
43
|
private
|
|
44
44
|
|
|
45
|
-
def record_label_for(
|
|
45
|
+
def record_label_for(class_name, id, type=nil)
|
|
46
46
|
return nil unless id
|
|
47
47
|
|
|
48
|
-
identifier = "#{
|
|
48
|
+
identifier = "#{class_name.to_s.underscore}_#{id}"
|
|
49
49
|
type_specifier = "(#{type})" if type
|
|
50
50
|
|
|
51
51
|
"__#{identifier}#{type_specifier}"
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dumped_railers
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Koji Onishi
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-12-
|
|
11
|
+
date: 2020-12-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|