Skip to content
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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

completed onboarding activity #26

wants to merge 5 commits into from

Conversation

lmieu
Copy link

@lmieu lmieu commented Jan 19, 2017

@jaybobo haven't touched authentication yet, but may do that in future

end

def move
@url = Url.where :bitly_clone => params[:short]
Copy link
Member

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
Copy link
Member

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'])
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants