-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
completed onboarding activity #26
base: master
Are you sure you want to change the base?
Conversation
end | ||
|
||
def move | ||
@url = Url.where :bitly_clone => params[:short] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Url.find_by(:bitly_clone => params[:short])
gives you either the found record or nil
. That simplifies the later code a little, since it isn't wrapped in an array.
validates :bitly_clone, uniqueness: true | ||
|
||
def bitly_generate | ||
rando_arr = ('a'..'z').to_a + ('A'..'Z').to_a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be a constant.
end | ||
|
||
def validate_url | ||
!!URI.regexp(['http','https']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand how this is being used. Doesn't this always return true
?
@jaybobo haven't touched authentication yet, but may do that in future