Skip to content

Instantly share code, notes, and snippets.

@fdutey fdutey/gist:50787
Created Jan 22, 2009

Embed
What would you like to do?
class Bookmark < ActiveRecord::Base
#Validations
validates_presence_of :label
validates_presence_of :url
def clean_url
url =~ /^http:\/\//i ? url : "http://#{url}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.