Skip to content

Instantly share code, notes, and snippets.

@xenda
Created June 12, 2013 13:27
Show Gist options
  • Save xenda/5765220 to your computer and use it in GitHub Desktop.
Save xenda/5765220 to your computer and use it in GitHub Desktop.
class User < ActiveRecord::Base
validates :password, presence: true, unless: :comes_from_facebook?
def comes_from_facebook?
self.fb_id? # o cualquier lógica que emplees
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment