I have in my upload_controller following function:
def analyse
(current_user.uploads).perform_analysis
respond_to do |format|
format.html { redirect_to :back }
end
meaning, that perform_analysis will analyse uploads only of one specific user, who is now online, say user A.
perform_analysis is situated in upload model.
def self.perform_analysis
blablabal
@upload=Upload.find_by_arraydb_file_name(x)
@upload.update_attributes(blablabla)
end
x is the name of the upload-file.
My problem is, that by calling this line
@upload=Upload.find_by_upload_file_name(x)
database has the following request:
select upload from uploads WHERE current_user=user A AND upload_file_name=x
I want the request to be only WHERE upload_file_name=x without current_user
How can I do it?
current_user.uploadsbringsWHERE current_user=userin sql query.