Hi
     I have a problem checking the uniquness of filename. My rails
controller  code is

if params[:document]["attachment"] &&
(current_user.documents.find(:all).map(&:attachment_file_name).include?
params[:document]["attachment"].original_filename)
      flash[:error] = "File already exists"
    else
       #store file
  ---------------

        I am using database storage. Now suppose if I am saving the file
cli ent&&list.gif paperclip save the attachemnt_file_name as
cli_ent_list.gif
      Again I am trying to upload the same file and in the above code it
goes to the else part and save the file since
params[:document]["attachment"].original_filename  will be
cli ent&&list.gif

I cant use validatesuniquness because of some reasons and have to use
the above code. Please tell me how can I solve this issue?

Thanks
Tom
-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to