Hello,
I have created a cut down version of technoweenie''s acts_as_attachment
for a project im working on. It has worked fine but now with what
appears to be a change to edge rails (did piston update on vendor/rails
this morning) it fails with the following error. I need the later
versions of edge rails for some active resource functions.
-----
Error:
A copy of Default::ImageBox::ActMethods has been removed from the module
tree but is still active!
I have attempted to fix with an addition to environment.rb
-----
config.load_once_paths
Here is my code for loading the plugin and the actsmethod.
--------
Init.rb
begin
require ''image_science''
rescue LoadError
# image_science not found
end
ActiveRecord::Base.send(:extend, Default::ImageBox::ActMethods)
-------
default/imagebox/image_box.rb
module Default # :nodoc:
module ImageBox # :nodoc:
module ActMethods
def image_box(options = {})
#set defaults
options[:thumbnails] ||= []
options[:storage_location] ||= File.join(''assets'',
''images'')
# only need to define these once on a class
unless included_modules.include? InstanceMethods
class_inheritable_accessor :box_options
validates_presence_of :source
before_save :store_data
after_save :box_images
after_destroy :destroy_box
include InstanceMethods
include FileSystemMethods
end
self.box_options = options
end
end
end
end
--
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---