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

Fixes #7616 - Use validates_lengths_from_database #4680

Merged
merged 1 commit into from Sep 26, 2014
Merged

Fixes #7616 - Use validates_lengths_from_database #4680

merged 1 commit into from Sep 26, 2014

Conversation

daviddavis
Copy link
Contributor

Note that unfortunately validates_lengths_from_database cannot be applied at a global level directly against ActiveRecord::Base, since the validates_length_from_database method requires the class to have a table name (with the ability to load the schema).

@daviddavis daviddavis changed the title [DO NOT REVIEW] Fixes #7616 - Use validates_lengths_from_database Fixes #7616 - Use validates_lengths_from_database Sep 23, 2014
@daviddavis daviddavis changed the title Fixes #7616 - Use validates_lengths_from_database [DO NOT REVIEW] Fixes #7616 - Use validates_lengths_from_database Sep 23, 2014
@daviddavis daviddavis changed the title [DO NOT REVIEW] Fixes #7616 - Use validates_lengths_from_database Fixes #7616 - Use validates_lengths_from_database Sep 24, 2014
@ehelms
Copy link
Member

ehelms commented Sep 24, 2014

I realize this are extremes, however, I figured out to check on larger lengths for various fields. On product create, I saw two different messages for label:

new product

@daviddavis
Copy link
Contributor Author

Yea, I talked with @jlsherrill about this yesterday. We decided to leave this as is for now. The best option would be to change the label field to 128 characters instead of 255 and then remove the length check from the LabelValidator but I didn't want to have to update all the label fields in our app.

Note that unfortunately validates_lengths_from_database cannot be applied at a
global level directly against ActiveRecord::Base, since the
validates_length_from_database method requires the class to have a table name
(with the ability to load the schema)
@daviddavis
Copy link
Contributor Author

Actually, looks like I can just exclude it from validates_lengths_from_database

@ehelms
Copy link
Member

ehelms commented Sep 26, 2014

ACK

daviddavis pushed a commit that referenced this pull request Sep 26, 2014
Fixes #7616 - Use validates_lengths_from_database
@daviddavis daviddavis merged commit 33f1b1c into Katello:master Sep 26, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants