Error with plugin module tree


#1

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


#2

I’ve realised that my commend on the piston update is misleading.

I have had the problem for a few weeks. The update i performed this
morning was a lazy hope its been fixed attempt.