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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7408bd3c1d02ff10b02e387037453b1a92ee3ea34e788e1a71eb8cc525cb8cb3
4
- data.tar.gz: 20591a7ec81c99031e1a02f0d92226f14098d0b6fe42162609cc14bcd2241bd5
3
+ metadata.gz: 440f4c535538d4dc81d6b117d26c27a9639146776b11fa5358ee90bbd8528b8b
4
+ data.tar.gz: ea53e8c0ca3a4220432bfcf40895e79a5bff18b616965b2627db7f78b73b39b0
5
5
  SHA512:
6
- metadata.gz: 3b1fe003568e67b17de96dd5f48de7bcf2ae5c1535325e0fb1756deaa6892af1eeead3e96d63e39fba68e2ec591c08305296b77f5a0d4ab3bec1e8fa209ca84d
7
- data.tar.gz: 8bb87ed990555e17e3177d3555634e621352e3af67147fa82e32790068380b6fd0fb7525b3b09c94efce231d23cc9e173a7e911656248f90a58cf2172184ed8c
6
+ metadata.gz: 847f16c2456ddd871963feee72a95e57bffac72a63c7c67f714b93dfb7c95698f0ee44f368b0f2166a1a1bd1cc4bd9a4bc3d084fd0fc556c055d233bcc9f67f9
7
+ data.tar.gz: 11e9d92b573fa02f1602af0035d5834648d6893b0b04c6ad64729c6b19504b99ba3ce1bdea7ee9c04a02e2833164a5c1e10e809badd8eacb09f06c35f4eb9c43
@@ -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
- model_name = attributes[rel.foreign_type.to_s]
26
-
25
+ class_name = attributes[rel.foreign_type.to_s]
26
+
27
27
  attributes[rel.name.to_s] = record_label_for(
28
- model_name,
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.name,
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(model_name, id, type=nil)
45
+ def record_label_for(class_name, id, type=nil)
46
46
  return nil unless id
47
47
 
48
- identifier = "#{model_name.to_s.underscore}_#{id}"
48
+ identifier = "#{class_name.to_s.underscore}_#{id}"
49
49
  type_specifier = "(#{type})" if type
50
50
 
51
51
  "__#{identifier}#{type_specifier}"
@@ -1,3 +1,3 @@
1
1
  module DumpedRailers
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
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.2
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-10 00:00:00.000000000 Z
11
+ date: 2020-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler