Permalink
Browse files

skinnier registrations controller, fatter registration model

  • Loading branch information...
1 parent d3f49c7 commit 5f1ba5f1329c1ce077c7c4094cbe03db650de9cd @croaky croaky committed Feb 3, 2011
Showing with 5 additions and 1 deletion.
  1. +1 −1 app/controllers/registrations_controller.rb
  2. +4 −0 app/models/registration.rb
View
2 app/controllers/registrations_controller.rb
@@ -20,6 +20,6 @@ def create
end
def index
- send_data Registration.all.to_csv(:only => [:name, :role, :twitter], :methods => [:school_name])
+ send_data Registration.stats
end
end
View
4 app/models/registration.rb
@@ -19,6 +19,10 @@ def self.designers
where(:role => "Designer").order("created_at desc")
end
+ def self.stats
+ all.to_csv(:only => [:name, :role, :twitter], :methods => [:school_name])
+ end
+
private
def find_or_create_school

0 comments on commit 5f1ba5f

Please sign in to comment.