README.md in traco-3.0.0 vs README.md in traco-3.1.0
- old
+ new
@@ -75,9 +75,11 @@
attr_accessible *locale_columns(:title, :body)
```
The return value will be sorted like `[:title_sv, :title_en, :body_sv, :body_en]`.
+`.current_locale_column(:title)`: Returns `:title_sv` if `:sv` is the current locale. Suitable for some SQL queries, such as sorting.
+
`.locales_for_attribute(:title)`: Returns an array like `[:sv, :en]` sorted with default locale first and then alphabetically.
And the equivalent methods for `body`, of course.
Please note that your `translates :title, :body` declaration must be called before you call `locale_columns`. Otherwise you will get an error like "NoMethodError: undefined method `locale\_columns' for #\<Class:0x00000003f69188\>".