Update I18n defaults for activerecord.errors.messages.record_invalid #5274

Merged
merged 3 commits into from Mar 5, 2012

Conversation

Projects
None yet
2 participants
@tigrish
Contributor

tigrish commented Mar 4, 2012

Allows translations of activerecord.errors.messages.record_invalid to in errors.messages.record_invalid

Allow translations of activerecord.errors.messages.record_invalid to …
…be looked up in errors.messages.record_invalid
@josevalim

This comment has been minimized.

Show comment Hide comment
@josevalim

josevalim Mar 5, 2012

Contributor

Thanks for your contribution but could you please add a test with it?

Contributor

josevalim commented Mar 5, 2012

Thanks for your contribution but could you please add a test with it?

@tigrish

This comment has been minimized.

Show comment Hide comment
@tigrish

tigrish Mar 5, 2012

Contributor

OK, test added

Contributor

tigrish commented Mar 5, 2012

OK, test added

@josevalim

View changes

...verecord/test/cases/validations/i18n_generate_message_validation_test.rb
+ @old_load_path, @old_backend = I18n.load_path.dup, I18n.backend
+ I18n.load_path.clear
+ I18n.backend = I18n::Backend::Simple.new
+ yield

This comment has been minimized.

Show comment Hide comment
@josevalim

josevalim Mar 5, 2012

Contributor

The following two lines should likely be inside an ensure block. So if a test fail its state doesn't leak.

@josevalim

josevalim Mar 5, 2012

Contributor

The following two lines should likely be inside an ensure block. So if a test fail its state doesn't leak.

@josevalim

View changes

...verecord/test/cases/validations/i18n_generate_message_validation_test.rb
@@ -8,6 +8,15 @@ def setup
I18n.backend = I18n::Backend::Simple.new
end
+ def reset_i18n_load_path(&block)

This comment has been minimized.

Show comment Hide comment
@josevalim

josevalim Mar 5, 2012

Contributor

No need to receive the block as argument here, since we are using yield. :)

@josevalim

josevalim Mar 5, 2012

Contributor

No need to receive the block as argument here, since we are using yield. :)

@tigrish

This comment has been minimized.

Show comment Hide comment
@tigrish

tigrish Mar 5, 2012

Contributor

Good call, test tweaked.

Contributor

tigrish commented Mar 5, 2012

Good call, test tweaked.

josevalim added a commit that referenced this pull request Mar 5, 2012

Merge pull request #5274 from tigrish/master
Update I18n defaults for activerecord.errors.messages.record_invalid

@josevalim josevalim merged commit c5a47b3 into rails:master Mar 5, 2012

@josevalim

This comment has been minimized.

Show comment Hide comment
@josevalim

josevalim Mar 5, 2012

Contributor

Merged, tks.

Contributor

josevalim commented Mar 5, 2012

Merged, tks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment