Sha256: ff1e7437052823f934009391cd7c1c3912d95ac3658eb18dcdb62e71519206b9

Contents?: true

Size: 600 Bytes

Versions: 11

Compression:

Stored size: 600 Bytes

Contents

module Octopus::Persistence
  def reload_connection()
    set_connection() if have_a_valid_shard?
  end

  def update_attribute(name, value)
    reload_connection()
    super(name, value)
  end

  def update_attributes(attributes)
    reload_connection()
    super(attributes)
  end

  def update_attributes!(attributes)
    reload_connection()
    super(attributes)
  end

  def reload
    reload_connection()
    super
  end
  
  def delete
    reload_connection()
    super
  end
  
  def destroy
    reload_connection()
    super
  end
end

ActiveRecord::Base.send(:include, Octopus::Persistence)

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
ar-octopus-0.0.18 lib/octopus/persistence.rb
ar-octopus-0.0.16 lib/octopus/persistence.rb
ar-octopus-0.0.15 lib/octopus/persistence.rb
ar-octopus-0.0.14 lib/octopus/persistence.rb
ar-octopus-0.0.13 lib/octopus/persistence.rb
ar-octopus-0.0.12 lib/octopus/persistence.rb
ar-octopus-0.0.11 lib/octopus/persistence.rb
ar-octopus-0.0.10 lib/octopus/persistence.rb
ar-octopus-0.0.9 lib/octopus/persistence.rb
ar-octopus-0.0.8 lib/octopus/persistence.rb
ar-octopus-0.0.7 lib/octopus/persistence.rb