Show More
Commit Description:
moved root/roles creation from migration to seed.rb
Commit Description:
moved root/roles creation from migration to seed.rb
References:
File last commit:
Show/Diff file:
Action:
app/models/announcement.rb
| 21 lines
| 678 B
| text/x-ruby
| RubyLexer
|
|
|
r97 | class Announcement < ActiveRecord::Base | ||
|
|
r151 | |||
|
|
r162 | def self.find_published(contest_started=false) | ||
| if contest_started | ||||
| Announcement.find(:all, | ||||
| :conditions => "(published = 1) AND (frontpage = 0)", | ||||
| :order => "created_at DESC") | ||||
| else | ||||
| Announcement.find(:all, | ||||
| :conditions => "(published = 1) AND (frontpage = 0) AND (contest_only = 0)", | ||||
| :order => "created_at DESC") | ||||
| end | ||||
|
|
r151 | end | ||
| def self.find_for_frontpage | ||||
| Announcement.find(:all, | ||||
| :conditions => "(published = 1) AND (frontpage = 1)", | ||||
| :order => "created_at DESC") | ||||
| end | ||||
|
|
r97 | end | ||
