Displaying 2 results from an estimated 2 matches for "globaldocument".
2006 Jun 20
2
Problem with "can''t dump anonymous class Class"
...ions.rb:118:in `transaction''
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/transac
tions.rb:126:in `save''
#{RAILS_ROOT}/app/controllers/enrollment_admin_controller.rb:34:in
`save_global_document''
-e:4
Any ideas on how to fix this? If I change GlobalDocument to Document below,
it works fine.
Here is the relevant code:
** Models **
class Document < ActiveRecord::Base
attr_accessor :uploaded_file
def after_create
if !File.exists?(File.dirname(self.file_path))
Dir.mkdir(File.dirname(self.file_path))
end
if @uploaded_fi...
2006 Jun 19
3
can''t dump anonymous class Class
...ile_name)
idx = file_name.rindex "."
self.name.gsub(/[^\w\.\_]/, ''_'') + file_name[idx, file_name.length -
idx]
end
def sanitize_filename(file_name)
File.expand_path("#{RAILS_ROOT}/public/documents/#{new_filename(file_name)}")
end
end
class GlobalDocument < Document
validates_uniqueness_of :name, :scope => :type
private
def sanitize_filename(file_name)
File.expand_path("#{RAILS_ROOT}/public/documents/global/#{new_filename(file_name)}")
end
end
** Controller **
def documents
@associations = Association.find(:all...