Created
October 14, 2009 14:19
-
-
Save anonymous/210105 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def new | |
@notice = Notice.new | |
respond_to do |format| | |
format.html # new.html.erb | |
format.xml { render :xml => @notice } | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Notice < ActiveRecord::Base | |
validates_presence_of :title, :description, :place, :number, :typemeet, :message => "- Uzupelnij wszystkie pola!" | |
validates_numericality_of :number, :only_integer => true | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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