Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def find_site
- site_id = params[:site_id].nil? ? params[:id] : params[:site_id]
- site_id = @user.site.id if site_id.eql?('primary')
- finder = site_id.to_s.match(/[a-z]+/).nil? ? :find : :find_by_hostname
- @site = @user.sites.send(finder,site_id)
- end
Add Comment
Please, Sign In to add comment