Skip to content

Commit

Permalink
Merge pull request #11 from bdurand/handle-corrupted-classes
Browse files Browse the repository at this point in the history
Handle edge cases in development and test on classes that become undefined
  • Loading branch information
bdurand authored Aug 26, 2024
2 parents 43b31dc + f792592 commit b199a9a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 1.2.4

### Fixed

- Fixed issue with `sync_all!` finding obsolete classes that are no longer defined as support tables in development or test environments.

## 1.2.3

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.3
1.2.4
1 change: 1 addition & 0 deletions lib/support_table_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ def support_table_classes(*extra_classes)
active_record_classes = ActiveRecord::Base.descendants.reject { |klass| klass.name.nil? }
active_record_classes.sort_by(&:name).each do |klass|
next unless klass.include?(SupportTableData)
next unless klass.instance_variable_defined?(:@support_table_data_files) && klass.instance_variable_get(:@support_table_data_files).is_a?(Array)
next if klass.abstract_class?
next if classes.include?(klass)
classes << klass
Expand Down

0 comments on commit b199a9a

Please sign in to comment.