diff options
| author | hukl <contact@smyck.org> | 2009-02-25 22:37:32 +0100 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2009-02-25 22:37:32 +0100 |
| commit | 2427889fd268dac5ea9dae7bfdf7e5af53dd799c (patch) | |
| tree | d9acdb20df3c8ab244689c5c602eda74fa2725de /app/models/page.rb | |
| parent | f4c73763e5b3d65f3377fb1238a94122a1c272a4 (diff) | |
added locale methods
Diffstat (limited to 'app/models/page.rb')
| -rw-r--r-- | app/models/page.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/page.rb b/app/models/page.rb index aba974a..ea481a6 100644 --- a/app/models/page.rb +++ b/app/models/page.rb | |||
| @@ -38,5 +38,12 @@ class Page < ActiveRecord::Base | |||
| 38 | :order => "#{options[:order_by]} #{options[:order_direction]}") | 38 | :order => "#{options[:order_by]} #{options[:order_direction]}") |
| 39 | end | 39 | end |
| 40 | 40 | ||
| 41 | def self.with_locale l, &block | ||
| 42 | old_locale = self.locale | ||
| 43 | self.locale = l | ||
| 44 | yield | ||
| 45 | self.locale = old_locale | ||
| 46 | end | ||
| 47 | |||
| 41 | # Instance Methods | 48 | # Instance Methods |
| 42 | end \ No newline at end of file | 49 | end \ No newline at end of file |
