public
Description: The open source social networking platform in Ruby on Rails from the author of RailsSpace
Homepage: http://insoshi.com
Clone URL: git://github.com/insoshi/insoshi.git
Search Repo:
Fixed message-everyone pagination bug
Michael Hartl (author)
Wed May 14 12:22:21 -0700 2008
commit  7053655da8b45f44c0afd3cbeffd4a4638d0ae45
tree    8f05a61a1d5584fa11b2d5884c35d355d6d03ef8
parent  c096fdf0962c92c188fe0cc64ae1fb555e4e3d0b
...
61
62
63
64
 
65
66
67
...
61
62
63
 
64
65
66
67
0
@@ -61,7 +61,7 @@
0
     
0
     if params["commit"] == "Send to all" and current_person.admin?
0
       # Send messages to all (active) people.
0
- messages = Person.active.inject([]) do |messages, person|
0
+ messages = Person.all_active.inject([]) do |messages, person|
0
         message = Message.new(params[:message].merge(:sender => current_person,
0
                                                      :recipient => person))
0
         messages.push(message)
...
99
100
101
102
 
103
104
105
106
107
108
 
 
 
 
 
 
109
110
111
...
99
100
101
 
102
103
104
105
106
107
 
108
109
110
111
112
113
114
115
116
0
@@ -99,13 +99,18 @@
0
 
0
   class << self
0
 
0
- # Return the active users.
0
+ # Return the paginated active users.
0
     def active(page = 1)
0
       paginate(:all, :page => page,
0
                      :per_page => RASTER_PER_PAGE,
0
                      :conditions => ["deactivated = ?", false])
0
     end
0
-
0
+
0
+ # Return *all* the active users.
0
+ def all_active
0
+ find(:all, :conditions => ["deactivated = ?", false])
0
+ end
0
+
0
     # People search.
0
     def search(options = {})
0
       query = options[:q]

Comments

    No one has commented yet.