Created
March 2, 2014 05:30
-
-
Save axilaris/9302368 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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