summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Sørensen <johan@johansorensen.com>2009-06-11 10:29:40 +0200
committerJohan Sørensen <johan@johansorensen.com>2009-06-11 10:29:40 +0200
commit7209ee63f8e5d596faec197e1d2393c9388b0c04 (patch)
tree9d2d1e80e0bcc5b478200425c50e8afae89eb68b
parent78fa25e94e7d88269394fb568102e1b9c96b7060 (diff)
downloadgitorious-mainline-outdated-7209ee63f8e5d596faec197e1d2393c9388b0c04.zip
gitorious-mainline-outdated-7209ee63f8e5d596faec197e1d2393c9388b0c04.tar.gz
gitorious-mainline-outdated-7209ee63f8e5d596faec197e1d2393c9388b0c04.tar.bz2
Pedantic line-length fixes in user.rb
-rw-r--r--app/models/user.rb22
1 files changed, 17 insertions, 5 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index c3a57a1..1581e6f 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -74,7 +74,8 @@ class User < ActiveRecord::Base
end
- has_many :received_messages, :class_name => "Message", :foreign_key => 'recipient_id', :order => "created_at DESC" do
+ has_many :received_messages, :class_name => "Message",
+ :foreign_key => 'recipient_id', :order => "created_at DESC" do
def unread
find(:all, :conditions => {:aasm_state => "unread"})
end
@@ -92,7 +93,9 @@ class User < ActiveRecord::Base
Message.find(:all, :conditions => ["sender_id = ? OR recipient_id = ?", self, self])
end
- Paperclip::Attachment.interpolations['login'] = lambda{|attachment,style| attachment.instance.login}
+ Paperclip::Attachment.interpolations['login'] = lambda{|attachment, style|
+ attachment.instance.login
+ }
avatar_local_path = '/system/:attachment/:login/:style/:basename.:extension'
has_attached_file :avatar,
@@ -102,15 +105,24 @@ class User < ActiveRecord::Base
# Top level messages either from or to me
def top_level_messages
- Message.find_by_sql(["SELECT * FROM messages WHERE (has_unread_replies=? AND sender_id=?) OR recipient_id=? AND in_reply_to_id IS NULL ORDER BY created_at DESC", true,self, self])
+ Message.find_by_sql(["SELECT * FROM messages
+ WHERE (has_unread_replies=? AND sender_id=?)
+ OR recipient_id=?
+ AND in_reply_to_id IS NULL
+ ORDER BY created_at DESC", true,self, self])
end
# Top level messages, excluding message threads that have been archived by me
def messages_in_inbox
- Message.find_by_sql(["SELECT * FROM messages WHERE ((sender_id=? AND archived_by_sender=?) OR (recipient_id=? AND archived_by_recipient=?)) AND in_reply_to_id IS NULL ORDER BY created_at DESC", self, false, self, false])
+ Message.find_by_sql(["SELECT * FROM messages
+ WHERE ((sender_id=? AND archived_by_sender=?)
+ OR (recipient_id=? AND archived_by_recipient=?))
+ AND in_reply_to_id IS NULL
+ ORDER BY created_at DESC", self, false, self, false])
end
- has_many :sent_messages, :class_name => "Message", :foreign_key => "sender_id", :order => "created_at DESC" do
+ has_many :sent_messages, :class_name => "Message",
+ :foreign_key => "sender_id", :order => "created_at DESC" do
def top_level
find(:all, :conditions => {:in_reply_to_id => nil})
end