Skip to content

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