You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not a bug per say, but I think this could potentially be a good improvement. When generating the key combinations for i18n translation for error messages, instead of building a list of all ancestors it only uses the last one in the list (It's looping through but overriding the previous value on each loop). Since lookup_ancestors generates the list from child > parent (parent being last), I can only specify a translation for the parent class.
Thank you so much for the issue but we don't take feature request on the issue tracker. We recommend you to try to implement the feature and send us a pull request or if you are in doubt if the feature will be accepts ask in Rails Core mailing list for feedback.
@rafaelfranca roger that. Yea that was my main thing. Wanted to make sure it was worthwhile before spending my time w/ the PR. Will check the mailing list. Thx.
Not a bug per say, but I think this could potentially be a good improvement. When generating the key combinations for i18n translation for error messages, instead of building a list of all ancestors it only uses the last one in the list (It's looping through but overriding the previous value on each loop). Since
lookup_ancestors
generates the list from child > parent (parent being last), I can only specify a translation for the parent class.https://github.com/rails/rails/blob/master/activemodel/lib/active_model/errors.rb#L389
By pushing onto the array instead of overwriting, this would allow me to (optionally) specify specific keys for STI (children).
For example if I have a class
class ClientUser < User
right now I the list only includes:By making this change, the list would include options for the child class as well:
The text was updated successfully, but these errors were encountered: