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

Followup to #1158 #1168

Merged
merged 3 commits into from
Nov 12, 2018
Merged

Followup to #1158 #1168

merged 3 commits into from
Nov 12, 2018

Conversation

jaredbeck
Copy link
Member

No description provided.

`has_many` will check the same thing
1. Users might (should) pass a frozen hash to us
2. Even if they don't, users will not expect their hash to be modified
@jaredbeck
Copy link
Member Author

jaredbeck commented Nov 11, 2018

@TylerRick a few minor follow-ups to your #1158 plz review thanks

d241663 and 1c06eed are the more interesting commits, 66fba21 is just code style

table_name through validate
]
end
end
Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch. 👍 Sorry, I sure thought I'd removed that already! Maybe it got added back by mistake when I did a rebase.

Copy link
Contributor

@TylerRick TylerRick Nov 12, 2018

Choose a reason for hiding this comment

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

Oh, I see it now. I'd forgotten to push up that commit (pushed now).

@jaredbeck jaredbeck merged commit 9c38cee into master Nov 12, 2018
@jaredbeck jaredbeck deleted the followup_1158 branch November 12, 2018 18:05
@@ -21,11 +21,12 @@ class ModelConfig
DPR_PASSING_ASSOC_NAME_DIRECTLY_TO_VERSIONS_OPTION = <<~STR.squish
Passing versions association name as `has_paper_trail versions: %{versions_name}`
is deprecated. Use `has_paper_trail versions: {name: %{versions_name}}` instead.
The hash you pass to `versions:` is now passed directly to `has_many`.
Copy link
Contributor

Choose a reason for hiding this comment

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

That's not actually true in the case of :name and :class_name.

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems odd to state the general rule in the warning message for the exact 2 cases that are the exceptions to that rule. :) The general rule is documented in the Readme; the only thing they need to know in the deprecation warning is what to change it to, which is already covered.

# - :versions - Either,
# - A String (deprecated) - The name to use for the versions
# association. Default is `:versions`.
# - A Hash - options passed to `has_many`, plus `name:` and `scope:`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch! Forgot about this documentation change.

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.

2 participants