Skip to content

Instantly share code, notes, and snippets.

Created October 14, 2009 14:19
Show Gist options
  • Save anonymous/210105 to your computer and use it in GitHub Desktop.
Save anonymous/210105 to your computer and use it in GitHub Desktop.
def new
@notice = Notice.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @notice }
end
end
class Notice < ActiveRecord::Base
validates_presence_of :title, :description, :place, :number, :typemeet, :message => "- Uzupelnij wszystkie pola!"
validates_numericality_of :number, :only_integer => true
end
class User < ActiveRecord::Base
acts_as_authentic
#attr_accessible :login, :email, :password, :password_confirmation, :username, :name, :age
def activate!
self.active = true
save
end
validates_datetime :age
validates_inclusion_of :gender, :in => %w{ Mezczyzna Kobieta}
def deliver_password_reset_instructions!
reset_perishable_token!
Notifier.deliver_password_reset_instructions(self)
end
def deliver_activation_instructions!
reset_perishable_token!
Notifier.deliver_activation_instructions(self)
end
def deliver_activation_confirmation!
reset_perishable_token!
Notifier.deliver_activation_confirmation(self)
end
def self.find_all_users
find (:all, :order => "id")
end
#attr_accessible :username, :email, :password, :name, :username, :age
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment