views:

24

answers:

1

Hello I am successfully setting I18n.locale in my app but the problem arise when I want to use it:

 @categories = Category.where(:tld => I18n.locale).all 

then I am getting strange sql condition:

 SELECT "categories".* FROM "categories" WHERE ("categories"."tld" = '--- :com')

however when I do logger.info(I18n.locale) I am getting correct output:

  com

I am new to rails and ruby and it looks like I am not accessing string value of I18n.locale.

Thanks!

A: 

I found simple and obvious solution:

 I18n.locale.to_s

Is there any simpler method?

Thanks

bogumbiker