Skip to content

Releases: bdurand/support_table_data

v1.6.1

09 May 01:33
Immutable release. Only release title and notes can be modified.
b0997b0

Choose a tag to compare

Fixed

  • Fixed issue with YARD and RBS documentation tasks possibly raising an error if a named value method is deprecated and wrapped to return an error. Types are now inferred directly from the data rather than calling a method.

Full Changelog: v1.6.0...v1.6.1

v1.6.0

09 May 01:24
Immutable release. Only release title and notes can be modified.

Choose a tag to compare

  • Added delete_missing option to sync_table_data! and sync_all!. When set to true, any records in the database that are not defined in the data files will be deleted. This option defaults to false to preserve backward compatibility.
  • Each model can now choose how its YARD docs are generated by setting self.support_table_yard_docs to :full (the default — verbose comment block per method), :compact (shared @!macro definitions plus a short @!method/@!macro pair per method, dramatically reducing comment-block size on tables with many named instances), or :none (skip generation entirely; previously generated docs are stripped on the next run). IDEs and yard doc resolve the compact form into the same per-method documentation as the verbose form.
  • Attribute helper return types in the generated YARD and RBS docs are now inferred per method by inspecting the value the helper actually returns (String, Integer, Boolean, etc.) instead of the generic Object/untyped. Because the helpers return frozen literals from the parsed data file, the documentation tasks no longer require a database connection.
  • Added opt-in RBS signature generation. The new tasks support_table_data:rbs, support_table_data:rbs:verify, and support_table_data:rbs:remove write/check/delete sig/<model_path>.rbs files so the named instance helpers are visible to Ruby LSP, Steep, RubyMine, and other RBS-aware tools without polluting the model source files. The output directory can be overridden with SupportTableData.rbs_signatures_path.

Full Changelog: v1.5.2...v1.6.0

v1.5.2

17 Feb 00:29
f21ccf5

Choose a tag to compare

Added

  • Added rubocop:disable all around generated YARD documentation to prevent RuboCop offenses in the generated code. This ensures that the generated documentation does not cause any issues with RuboCop linting in the project.

Full Changelog: v1.5.1...v1.5.2

v1.5.1

16 Feb 20:14
547b85a

Choose a tag to compare

Added

  • YARD documentation tasks can now take an optional file path argument to add, verify, or remove documentation for a specific support table model instead of all models. For example, you can run bundle exec rake support_table_data:yard_docs:add[app/models/color.rb] to add documentation for the Color model.
  • Added comment in generated YARD documentation indicating the command to run to update them so that it's clear to users how to keep the documentation up to date.
  • Aliased support_table_data:yard_docs to support_table_data:yard_docs:add for convenience since adding the documentation is the most common action.

Full Changelog: v1.5.0...v1.5.1

v1.5.0

09 Jan 16:48
1cbec5f

Choose a tag to compare

Added

  • The default data directory in a Rails application can be set with the config.support_table.data_directory option in the Rails application configuration.
  • Added rake task support_table_data:yard_docs:add for Rails applications that will add YARD documentation to support table models for the named instance helpers. There is also a task support_table_data:yard_docs:verify that can be used in a build pipeline to verify that the documentation is up to date. You can also remove the documentation with the support_table_data:yard_docs:remove task.
  • The data synchronization task is now automatically attached to several Rails tasks: db:seed, db:seed:replant, db:prepare, db:test:prepare, db:fixtures:load. Support tables will be synced after running any of these tasks. This can be disabled by setting config.support_table.auto_sync = false in the Rails application configuration.

Changed

  • The default data directory is now set in a Railtie and can be overridden with the config.support_table.data_directory option in the Rails application configuration.
  • The support_table_key_attribute method now returns "id" if not explicitly set instead of implicitly interpreting nil as the primary key. This makes the behavior more consistent and explicit and avoids edge cases when running the code in environments where the database connection is not available. This is a breaking change if the table uses a primary key other than "id" and the support_table_key_attribute was not explicitly set to that primary key.

Full Changelog: v1.4.0...v1.5.0

v1.4.0

09 Jan 16:48
a87b2d1

Choose a tag to compare

Fixed

  • Honor single table inheritance class when creating new records in the database. This fixes issues where validations and callbacks on subclasses could be skipped when creating new records.

Removed

  • Removed support for ActiveRecord versions prior to 6.1.

Full Changelog: v1.3.1...v1.4.0

v1.3.1

30 Jan 23:29
ced83c5

Choose a tag to compare

What's Changed

  • Added support for autosave associations. Data in autosave associations will be persisted when the support table is synced if it was changed by the support table data.

Full Changelog: v1.3.0...v1.3.1

v1.3.0

30 Jan 23:22
9bf56a1

Choose a tag to compare

What's Changed

  • Added support_table_dependency method to explicitly define support table dependencies that cannot be inferred from model associations.

Full Changelog: v1.2.4...v1.3.0

v1.2.4

26 Aug 17:03
b199a9a

Choose a tag to compare

What's Changed

  • Handle edge cases in development and test on classes that become undefined by @bdurand in #11

Full Changelog: v1.2.3...v1.2.4

v1.2.2

21 Aug 17:52
fa78e8f

Choose a tag to compare

What's Changed

  • Add thread safety around modifying internal class variables by @bdurand in #9

Full Changelog: v1.2.1...v1.2.2