Sha256: 21fa7e2906971b06e1a218448a6999b4da8979b3bbfde10600ea5bf2c38eabaa

Contents?: true

Size: 921 Bytes

Versions: 16

Compression:

Stored size: 921 Bytes

Contents

# Provides the mechinism to support applications that want to observe MList
# models.
#
# ActiveRecord observers are reloaded at each request in development mode.
# They will be registered with the MList models each time. Since the MList
# models are required once at initialization, there will always only be one
# instance of the model class, and therefore, many instances of the observer
# class registered with it; all but the most recent are invalid, since they
# were undefined when the dispatcher reloaded the application.
#
# Should we ever have observers in MList, this will likely need more careful
# attention.
#
unless Rails.configuration.cache_classes
  class << ActiveRecord::Base
    def instantiate_observers_with_mlist_observers
      subclasses.each(&:delete_observers)
      instantiate_observers_without_mlist_observers
    end
    alias_method_chain :instantiate_observers, :mlist_observers
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
aiwilliams-mlist-0.1.7 rails/init.rb
aiwilliams-mlist-0.1.8 rails/init.rb
mlist-0.1.23 rails/init.rb
mlist-0.1.22 rails/init.rb
mlist-0.1.21 rails/init.rb
mlist-0.1.20 rails/init.rb
mlist-0.1.19 rails/init.rb
mlist-0.1.18 rails/init.rb
mlist-0.1.17 rails/init.rb
mlist-0.1.16 rails/init.rb
mlist-0.1.14 rails/init.rb
mlist-0.1.13 rails/init.rb
mlist-0.1.12 rails/init.rb
mlist-0.1.11 rails/init.rb
mlist-0.1.10 rails/init.rb
mlist-0.1.9 rails/init.rb