Releases: bdurand/support_table_data
Releases · bdurand/support_table_data
v1.6.1
Immutable
release. Only release title and notes can be modified.
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
Immutable
release. Only release title and notes can be modified.
- Added
delete_missingoption tosync_table_data!andsync_all!. When set totrue, any records in the database that are not defined in the data files will be deleted. This option defaults tofalseto preserve backward compatibility. - Each model can now choose how its YARD docs are generated by setting
self.support_table_yard_docsto:full(the default — verbose comment block per method),:compact(shared@!macrodefinitions plus a short@!method/@!macropair 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 andyard docresolve 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 genericObject/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, andsupport_table_data:rbs:removewrite/check/deletesig/<model_path>.rbsfiles 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 withSupportTableData.rbs_signatures_path.
Full Changelog: v1.5.2...v1.6.0
v1.5.2
Added
- Added
rubocop:disable allaround 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
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 theColormodel. - 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_docstosupport_table_data:yard_docs:addfor convenience since adding the documentation is the most common action.
Full Changelog: v1.5.0...v1.5.1
v1.5.0
Added
- The default data directory in a Rails application can be set with the
config.support_table.data_directoryoption in the Rails application configuration. - Added rake task
support_table_data:yard_docs:addfor Rails applications that will add YARD documentation to support table models for the named instance helpers. There is also a tasksupport_table_data:yard_docs:verifythat can be used in a build pipeline to verify that the documentation is up to date. You can also remove the documentation with thesupport_table_data:yard_docs:removetask. - 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 settingconfig.support_table.auto_sync = falsein 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_directoryoption in the Rails application configuration. - The
support_table_key_attributemethod now returns "id" if not explicitly set instead of implicitly interpretingnilas 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 thesupport_table_key_attributewas not explicitly set to that primary key.
Full Changelog: v1.4.0...v1.5.0
v1.4.0
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
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
What's Changed
- Added
support_table_dependencymethod to explicitly define support table dependencies that cannot be inferred from model associations.
Full Changelog: v1.2.4...v1.3.0