Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class User < ActiveRecord::Base
- attr_accessible :email, :first_name, :last_name, :username
- before_validation :lol, :on => :create
- before_validation :yay, :on => :create
- before_validation :yay, :on => :update
- def lol
- puts "Running lol"
- end
- def yay
- puts "Running yay"
- end
- end
- a = User.new()
- a.save!
- ...
- only prints
- Running lol
Add Comment
Please, Sign In to add comment