Created
October 9, 2010 05:02
-
-
Save ch1ago/617903 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
# encoding: utf-8 | |
class User < ActiveRecord::Base | |
# Include default devise modules. Others available are: | |
# :token_authenticatable, :confirmable, :lockable and :timeoutable | |
devise :database_authenticatable, :registerable, | |
:recoverable, :rememberable, :trackable, :validatable, | |
:lockable | |
attr_accessible :full_name, :gender, :gender_policy, :birth, :birth_policy, | |
:time_zone, :background, :background_repeat_policy, :flavour, :description, | |
:website, :locale, :local | |
validates_length_of :username, :in => 6..20 | |
has_attached_file :background, MyConfig.paperclip_options | |
#validates_attachment_content_type :background, :content_type => ['image/jpeg', 'image/gif', 'image/png'] | |
#validates_attachment_size :background, :less_than => 1.megabytes | |
any paperclip validators will keep me from saving the model if :background is nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment