app/models/concerns/cartodb_central_synchronizable.rb
# Can't be added to the model because if user creation begins at Central we can't know if user is the same or existing
Can't be added to the model because if user creation begins at Central we can't know if user is the same or existing
Can ' t be added to the model because if user creation begins at Central we can ' t know if user is the same or existing
def validate_credentials_not_taken_in_central
    return true unless user?
    return true unless Cartodb::Central.sync_data_with_cartodb_central?
    central_client = Cartodb::Central.new
    errors.add(:username, 'Username taken') if central_client.get_user(username)['username'] == username
    errors.add(:email, 'Email taken') if central_client.get_user(email)['email'] == email
    errors.empty?
  end
def validate_credentials_not_taken_in_central return true unless user? return true unless Cartodb :: Central . sync_data_with_cartodb_central? central_client = Cartodb :: Central . new errors . add ( :username , 'Username taken' ) if central_client . get_user ( username ) [ 'username' ] == username errors . add ( :email , 'Email taken' ) if central_client . get_user ( email ) [ 'email' ] == email errors . empty? end
Can't be added to the model because if user creation begins at Central we can't know if user is the same or existing
Can ' t be added to the model because if user creation begins at Central we can ' t know if user is the same or existing