Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ActiveRecord changes return nilable types #112

Merged
merged 1 commit into from Aug 26, 2020
Merged

Conversation

Morriar
Copy link
Collaborator

@Morriar Morriar commented Aug 25, 2020

All the ActiveRecord methods used to access the previous change state of a column can actually return nil.

For example:

class Foo < ApplicationRecord; end

foo = Foo.new(name: "foo")
foo.name_previous_change # => nil

This pull-request uses T.nilable as return type for all the impacted methods.

Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Copy link
Member

@paracycle paracycle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks!

@Morriar Morriar merged commit c2ddb09 into master Aug 26, 2020
@Morriar Morriar deleted the at-fix-ar-changes-types branch August 26, 2020 20:05
@paracycle paracycle temporarily deployed to production August 26, 2020 21:10 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants