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
In pull request #332, an acronym inflection is added to support the incorrect class name Spree::GateWay::SecurePayAU (app/models/spree/gateway/secure_pay_au.rb).
Because Zeitwork doesn't like the naming scheme of SecurePayAU.
This inflection causes unexpected behavior when using .titleize on a string.
Due to this change the the brand WALDLAUFER is titleized Waldl AU Fer.
This inflection also causes Zeitwerk issues on every AU classname.
If the capitalized AU is important, (for backwards compatibility).
Isn't it a better solution to just add alias for this class.
Solution
I think best solution is to remove the inflection and rename the class from SecurePayAU to SecurePayAu. Of course this can/will be an issue with existing installations.
Backwards compatibility Solution
Another solution is the following
Remove the inflection: config/initializers/inflections.rb
# DELETE: inflect.acronym 'AU'
Rename the class and add an alias for the class to app/models/spree/gateway/secure_pay_au.rb, so it follows the Zeitwerk naming
In pull request #332, an acronym inflection is added to support the incorrect class name
Spree::GateWay::SecurePayAU
(app/models/spree/gateway/secure_pay_au.rb).Because Zeitwork doesn't like the naming scheme of SecurePayAU.
This inflection causes unexpected behavior when using .titleize on a string.
Due to this change the the brand
WALDLAUFER
is titleizedWaldl AU Fer
.This inflection also causes Zeitwerk issues on every AU classname.
If the capitalized
AU
is important, (for backwards compatibility).Isn't it a better solution to just add alias for this class.
Solution
I think best solution is to remove the inflection and rename the class from
SecurePayAU
toSecurePayAu
. Of course this can/will be an issue with existing installations.Backwards compatibility Solution
Another solution is the following
Remove the inflection:
config/initializers/inflections.rb
# DELETE: inflect.acronym 'AU'
Rename the class and add an alias for the class to
app/models/spree/gateway/secure_pay_au.rb
, so it follows the Zeitwerk namingIn the
lib/spree_gateway/engine.rb
register both classes OR use the following construct to load the legacy classname.The text was updated successfully, but these errors were encountered: