diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/journal.rb | 1 | ||||
-rw-r--r-- | app/models/user.rb | 4 | ||||
-rw-r--r-- | app/models/user_preference.rb | 3 |
3 files changed, 8 insertions, 0 deletions
diff --git a/app/models/journal.rb b/app/models/journal.rb index d757ef90d..7c5e3d3bf 100644 --- a/app/models/journal.rb +++ b/app/models/journal.rb @@ -23,6 +23,7 @@ class Journal < ActiveRecord::Base belongs_to :user has_many :details, :class_name => "JournalDetail", :dependent => :delete_all + attr_accessor :indice acts_as_searchable :columns => 'notes', :include => :issue, diff --git a/app/models/user.rb b/app/models/user.rb index 22d66539d..2dd698f28 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -144,6 +144,10 @@ class User < ActiveRecord::Base self.pref.time_zone.nil? ? nil : TimeZone[self.pref.time_zone] end + def wants_comments_in_reverse_order? + self.pref[:comments_sorting] == 'desc' + end + # Return user's RSS key (a 40 chars long string), used to access feeds def rss_key token = self.rss_token || Token.create(:user => self, :action => 'feeds') diff --git a/app/models/user_preference.rb b/app/models/user_preference.rb index 1ed9e0fd9..73e4a50c6 100644 --- a/app/models/user_preference.rb +++ b/app/models/user_preference.rb @@ -46,4 +46,7 @@ class UserPreference < ActiveRecord::Base self.others.store attr_name, value end end + + def comments_sorting; self[:comments_sorting] end + def comments_sorting=(order); self[:comments_sorting]=order end end |