Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Build a Todo List Application with Rails 4 Build a Todo List Application with Rails 4 Validating Length

Kalen Loncar
Kalen Loncar
8,743 Points

I18n.enforce_available_locales = false... why?

At 4:15 in the video, for his 4th test Jason adds in this line of code because he gets a warning in his prompt. I didn't get the same warning, (I'm using the windows command prompt.) Why does he add this? Why not just ignore the warning? He doesn't explain why it came up or what the code does. Or I missed it, if so please be patient with me.. thank you!

1 Answer

Hi there,

The validation of your locale used to be optional defaulting to not being validated. At some point, this default changed such that your locale would always be validated unless you add that line of code.

If your app isn't locale-specific then there seems little need to have it validated which is presumably why Jason set this parameter to false.

I hope that helps!

Steve.