exwiw 0.1.3 → 0.1.4

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: 83fdfcea806c556f4eace82d26f2c5fcd08b05c37ee1396b14e3752110e17b73
4
- data.tar.gz: 38fc8c299154dab02fd23d1c39d09453ebeaf66be611127453b46908bbe70986
3
+ metadata.gz: b5120d6bb2e0b1e32096c8461b5feba65248b3c48e491e94fda0b439a73cfe05
4
+ data.tar.gz: 11ebd135b111b71666c505dd6fb964007cc6fd88143c96d0fb0a5d3df2c7f99e
5
5
  SHA512:
6
- metadata.gz: 2192f38b947c07a5118defa2160316411c5e60f77398b2859d9b31b59079fbabcd2ecb7436071d2ec79629073bdd7339bdc71def16cb709955e8728d363c91dd
7
- data.tar.gz: da4fd038b0b21ff9255f5f5d72ad5dbe1b4a42c9d28a4c0e60af19f700c8a82c45226091bad43bdaecda49d5bbc07fb4a7bc8337ffecd793ce4509abd1955b9d
6
+ metadata.gz: 10a26785c8ee4d505494fc8576dc9267b4fb20f79a944962dbd6f2d659286b0fe90f06523e18ea597561f6ee18d74255acc765665b992504544b62a05983f4c5
7
+ data.tar.gz: 4bf778905971b929da83c0af4e82245a33efc2a5a303ab4a403cb32e68ab3c07c1811cd69562ef70789f515986d92309c3f6b17011245fdbebf498ce311901d0
data/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.1.4] - 2026-04-04
6
+
7
+ ### Fixed
8
+
9
+ - Skip models whose table does not exist in `exwiw:schema:generate` task.
10
+ - Add trailing newline to generated schema files.
11
+ - Fixed foreign key constraint errors when exporting child tables with filters on intermediate tables. Filters from intermediate tables are now correctly included in JOIN clauses. ([#3](https://github.com/riseshia/exwiw/pull/3))
12
+
5
13
  ## [0.1.3] - 2025-04-02
6
14
 
7
15
  ### Fixed
@@ -20,7 +20,9 @@ module Exwiw
20
20
  join_table_name: join_table_name,
21
21
  primary_key: primary_key,
22
22
  }
23
- hash[:where_clauses] = where_clauses.map(&:to_h) if where_clauses.size.positive?
23
+ if where_clauses.size.positive?
24
+ hash[:where_clauses] = where_clauses.map { |wc| wc.is_a?(String) ? wc : wc.to_h }
25
+ end
24
26
  hash
25
27
  end
26
28
  end
@@ -61,6 +61,11 @@ module Exwiw
61
61
  )
62
62
  end
63
63
 
64
+ # Add filter from intermediate table to join clause
65
+ if to_table.filter
66
+ join_clause.where_clauses.push to_table.filter
67
+ end
68
+
64
69
  join_clauses.push(join_clause)
65
70
  end
66
71
 
data/lib/exwiw/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Exwiw
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.4"
5
5
  end
data/lib/tasks/exwiw.rake CHANGED
@@ -14,6 +14,7 @@ namespace :exwiw do
14
14
 
15
15
  ActiveRecord::Base.descendants.each do |model|
16
16
  next if model.abstract_class?
17
+ next unless model.table_exists?
17
18
  next if table_by_name[model.table_name]
18
19
 
19
20
  belongs_tos = model.reflect_on_all_associations(:belongs_to).map do |assoc|
@@ -51,9 +52,9 @@ namespace :exwiw do
51
52
  if File.exist?(path)
52
53
  current_config = Exwiw::TableConfig.from(JSON.parse(File.read(path)))
53
54
  merged_config = current_config.merge(table)
54
- File.write(path, JSON.pretty_generate(merged_config.to_hash))
55
+ File.write(path, JSON.pretty_generate(merged_config.to_hash) + "\n")
55
56
  else
56
- File.write(path, JSON.pretty_generate(table.to_hash))
57
+ File.write(path, JSON.pretty_generate(table.to_hash) + "\n")
57
58
  end
58
59
  end
59
60
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exwiw
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shia
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-04-02 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: serdes
@@ -73,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0'
75
75
  requirements: []
76
- rubygems_version: 3.6.2
76
+ rubygems_version: 4.0.3
77
77
  specification_version: 4
78
78
  summary: Ruby gem that allows you to export records from a database to a dump file.
79
79
  test_files: []