Skip to content

Instantly share code, notes, and snippets.

@axilaris
Created March 2, 2014 05:30
Show Gist options
  • Save axilaris/9302368 to your computer and use it in GitHub Desktop.
Save axilaris/9302368 to your computer and use it in GitHub Desktop.
def edit
logger.info "XXX CompaniesController edit id:#{params[:id]}"
if userpartofcompany
logger.info "XXX YES"
else
logger.info "XXX NO"
end
end
def userpartofcompany
@theuser = current_user
@companyfind = CompanyUserAssoc.where(:company_id => params[:id], :user_id => @theuser.id)
if @companyfind.count(true) > 0
@isuserpartofcompany = true
return true
else
@isuserpartofcompany = false
return false
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment