Forum: Ruby on Rails Error with plugin module tree

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Adam m. (Guest)
on 2007-03-08 12:45
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.

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


Here is my code for loading the plugin and the actsmethod.

  require 'image_science'
rescue LoadError
  # image_science not found
ActiveRecord::Base.send(:extend, Default::ImageBox::ActMethods)


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

        self.box_options = options
Adam m. (Guest)
on 2007-03-08 12:46
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.
This topic is locked and can not be replied to.