diff options
Diffstat (limited to 'app/models')
| -rw-r--r-- | app/models/page.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/page.rb b/app/models/page.rb index 817e3bd4..cf003f74 100644 --- a/app/models/page.rb +++ b/app/models/page.rb | |||
| @@ -83,7 +83,7 @@ class Page < ApplicationRecord | |||
| 83 | 83 | ||
| 84 | if options[:order_by] == "title" | 84 | if options[:order_by] == "title" |
| 85 | return scope | 85 | return scope |
| 86 | .order(Arel.sql("(SELECT pt.title FROM page_translations pt WHERE pt.page_id = pages.id AND pt.locale = #{ActiveRecord::Base.connection.quote(I18n.locale.to_s)}) #{direction}")) | 86 | .order(Arel.sql("(SELECT pt.title FROM page_translations pt WHERE pt.page_id = pages.id AND pt.locale = #{ActiveRecord::Base.connection.quote(Globalize.locale.to_s)}) #{direction}")) |
| 87 | .paginate(:page => page, :per_page => options[:limit]) | 87 | .paginate(:page => page, :per_page => options[:limit]) |
| 88 | end | 88 | end |
| 89 | 89 | ||
| @@ -145,7 +145,7 @@ class Page < ApplicationRecord | |||
| 145 | return true unless template_name == draft.template_name | 145 | return true unless template_name == draft.template_name |
| 146 | return true unless translated_locales.sort_by(&:to_s) == draft.translated_locales.sort_by(&:to_s) | 146 | return true unless translated_locales.sort_by(&:to_s) == draft.translated_locales.sort_by(&:to_s) |
| 147 | changed = false | 147 | changed = false |
| 148 | translated_locales.each { |locale| I18n.with_locale(locale) { changed = true unless title == draft.title && abstract == draft.abstract && body == draft.body } } | 148 | translated_locales.each { |locale| Globalize.with_locale(locale) { changed = true unless title == draft.title && abstract == draft.abstract && body == draft.body } } |
| 149 | return changed | 149 | return changed |
| 150 | end | 150 | end |
| 151 | 151 | ||
