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

Repair error of to_param when no slug column #22

Merged
merged 3 commits into from
Jun 16, 2019
Merged

Repair error of to_param when no slug column #22

merged 3 commits into from
Jun 16, 2019

Conversation

wbreeze
Copy link
Contributor

@wbreeze wbreeze commented Jun 13, 2019

This is to repair issue 20

It adds two tests for the to_param instance method:

  • one which ensures override when there is a slug
  • the other ensures no change in behavior on models without a slug

The fix proposed and imlemented here is to extend models with the slug instance methods only when slug is invoked at the class level.

@wbreeze wbreeze marked this pull request as ready for review June 13, 2019 21:22
@@ -36,63 +36,66 @@ def slug source, opts={}
with: /\A[a-z0-9-]+\z/,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The diff on this file is much clearer when viewed without the white space changes. We indented several methods within a module.

@bkoski
Copy link
Owner

bkoski commented Jun 16, 2019

This is a great improvement, thank you! (and thanks for the context in the PR)

@bkoski bkoski merged commit ff1f680 into bkoski:master Jun 16, 2019
@wbreeze wbreeze deleted the i20 branch June 17, 2019 18:17
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