Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add *_previously_was attribute methods when dirty tracking#36836

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
dhh merged 2 commits intomasterfromattribute_previously_was
Aug 1, 2019

Conversation

@dhh
Copy link
Member

@dhhdhh commentedAug 1, 2019

Add *_previously_was attribute methods when dirty tracking. Example:

pirate.update(catchphrase:"Ahoy!")pirate.previous_changes["catchphrase"]# => ["Thar She Blows!", "Ahoy!"]pirate.catchphrase_previously_was# => "Thar She Blows!"

joshuapinter, OlgaCoskun, likeuwill, lioneldebauge, ansonhoyt, pedrofurtado, biow0lf, sgput, nezirz, jesusabarca, and 11 more reacted with thumbs up emoji
@dhhdhh merged commita0bb19f intomasterAug 1, 2019
@dhhdhh deleted the attribute_previously_was branchAugust 1, 2019 22:38
@OlgaCoskun
Copy link

intresting!)

@mikker
Copy link
Contributor

Just curious, feel free to ignore,@dhh: How do you use this in Basecamp (or that secret thing)? Like,use this in a sentence in the Dictionary 😊

@kaspth
Copy link
Contributor

@mikker something likereport_default_collections if collectable_id_previously_was.blank? is one,saved_change_to_status? && status_previously_was.inquiry.trashed? && active? is another. All inafter_* callbacks, of course. 😊

tadeusrox, joshmn, rainerborene, and albertoalmagro reacted with thumbs up emoji

@mikker
Copy link
Contributor

mikker commentedOct 7, 2019
edited
Loading

Thanks Kasper! 🙏

@maxp-hover
Copy link

Um, so I know it's kinda late to bring this up, but why didn't we useprevious_value?

attr_previously_was.blank? sounds natural, butold_attr = thing.attr_previously_was just doesn't read like proper grammar, I expect an adjective after that. Meanwhileprevious_value works in both cases.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@dhh@OlgaCoskun@mikker@kaspth@maxp-hover

[8]ページ先頭

©2009-2025 Movatter.jp