This repository has been archived by the owner on Jul 5, 2023. It is now read-only.
Releases: chanzuckerberg/sorbet-rails
Releases · chanzuckerberg/sorbet-rails
0.7.3
Changelog for version 0.7.3:
- Add support for
serialized
attribute. Thanks to @alexdunae - Add codegen for
reload_<assoc>
method. Thanks to @DanielGilchrist - Improve
pluck_to_tstruct
to use prop default value when applicable. Thanks to @DanielGilchrist - Add debug mode via
SBR_DEBUG_MODE
. In debug mode, plugin errors will be raised - Some small bug fixes
0.7.2
Changelog for version 0.7.2
- Fix
ActiveJob.perform_now
and.perform_later
return an instance of the job class. Thanks to @xcskier56 - Generate a model
T::Enum
as a nested class. Thanks to @ghiculescu - Small bug fixes
0.7.1
- Allow user to customize the RBI Generator for Job and Mailer
- Handle UUIDs and have the _ids method return the correct type (T::Array[String]). Thanks to Connor Shea @connorshea
- Add plucking association suport to
pluck_to_struct
. Thanks to Daniel Gilchrist @DanielGilchrist - Add another method to Kaminary gem plugin. Thanks to Alex Ghiculescu @ghiculescu
- Generates
build_*
andcreate_*
methods for model associations. Thanks to Alex Ghiculescu @ghiculescu
0.7.0
- Drop
fetch_typed
andrequire_typed
in favor ofTypedParams
- Drop
IntegerString
andBooleanString
due to unnecessary performance cost. - Fix GeneratedUrlHelpers work with _path method out of the box
- Add an RBI file for
typed_enum
.
Note: There are some incompatible changes in this release. It's recommended to remove all references of the removed APIs in your code and in generated RBI before upgrading. For generated RBI (ie hidden-definitions.rbi), you can also regenerate the RBI to remove reference to removed constants.
Note: typed_enum
signature will conflict with a generated signature in hidden-definitions/hidden.rbi
. You can either remove the one in hidden.rbi
manually or regenerate it running srb rbi hidden-definitions
(slow).
0.6.5.1
0.6.5
- Add signature generation for Relation's
in_batches
method. Thanks to Jeff Carbonella @jeffcarbs - Fix a few issues with Ruby 2.7's keyword parameters. Thanks to Connor Shea @connorshea
- Fix the codegen for named scope in Rails 6.0
0.6.4
- Cut the time running
rails_rbi:models
significantly. (In my repo from 6m30 to 1m). BOOM! Thanks to Jeff Carbonella @jeffcarbs - Reduce generated RBI size by moving query methods into modules. Thanks to Jeff Carbonella @jeffcarbs
- Better handle types of polymorphic assoc when class_name/source type is available. Thanks to Jeff Carbonella @jeffcarbs
- Stop inferring "validates :on" as unconditional. Thanks to Paul Ramon Revilla @masylum
0.6.3
- Generate
ActiveRecord::Relation
type methods dynamically and and many methods toAssociationRelation
&AssociationCollectionProxy
. Massive thanks to Jeff Carbonella @jeffcarbs - Improve the handling of
HABTM
associations. Thanks to Jonathan Schatz @modosc - Generate collection ids retrieval method. Thanks to Alex Ghiculescu @ghiculescu
- Use percent-string in
TypedEnum
to avoid issue with strings containing quotes. Thanks to Kevin Miller @Gasparila - Improve typing of attributes with Array type (Postgres). Thanks to Kevin Miller @Gasparila
- Add deprecation warning for
fetch_typed
,require_typed
,BooleanString
andIntegerString
in favor ofTypedParams
. They are slated to removal in v0.7. For alternatives, see the warning or see #318
0.6.2
0.6.1
- Change model attribute setter signature accepts more Numeric value. Thanks to Kevin Miller @Gasparila
- Add XXX::RelationType alias. Thanks to Paul Ramona Revilla @masylum
- Fixed mailer rbi generation to work even when the mailing method has parameters with a default value
- Upgrade sorbet-coerce & fix the issue with
srb --lsp