app/models/announcement.rb in cartoonist-announcements-0.0.5 vs app/models/announcement.rb in cartoonist-announcements-0.0.6
- old
+ new
@@ -1,5 +1,6 @@
class Announcement < ActiveRecord::Base
+ attr_accessible :posted_at, :expired_at, :title, :content, :location, :enabled
validate :posted_at_must_be_before_expired_at, :posted_at_must_exist_if_expired_at_exists
def posted_at_must_be_before_expired_at
if posted_at && expired_at && posted_at > expired_at
errors.add :posted_at, "must be before expiration"