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

Remove translation from Spree::LineItem #875

Merged
merged 1 commit into from
Feb 18, 2016
Merged

Conversation

SebAshton
Copy link
Contributor

Due to [what I assume is] the Rails load order, this hard code translation prohibits include/prepend/extend decoration of Spree::LineItem as the locales aren’t loaded yet.

I also believe this to be redundant, as there is a before_validation method to ensure the quantity is never less than 0 on Line 15

Due to [I assume] the Rails load order, it this translation prohibits include/prepend/extend decoration of Spree::LineItem as the locales aren’t loaded yet. I also believe this to be redundant, as there is a before_validation method to ensure the quantity is never less than 0 on #L15
@cbrunsdon
Copy link
Contributor

I'm not sure I follow whats going wrong with your attempts to extend it, but I am 👍 as I see no reason to need the custom translation here.

@jhawthorn
Copy link
Contributor

Nice catch.

To reiterate, this Spree.t is run at class load time, so this translation wouldn't show up in the correct locale (this can be done using validations by passing a symbol).

Thanks very much @SebAshton 👍

jhawthorn added a commit that referenced this pull request Feb 18, 2016
Remove translation from Spree::LineItem
@jhawthorn jhawthorn merged commit 6d705a3 into solidusio:master Feb 18, 2016
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.

None yet

3 participants