Sha256: f6ba708c310358ac8679cc65e8e78982f9b6b46608639330744c592cc323272e

Contents?: true

Size: 891 Bytes

Versions: 15

Compression:

Stored size: 891 Bytes

Contents

class CmReplicationConnection < ActiveRecord::Base
  establish_managed_connection(:slave_1_cm_test)
end

class CmReplication2Connection < ActiveRecord::Base
  establish_managed_connection(:slave_2_cm_test)
end

class Basket < ActiveRecord::Base
  has_many :fruit_baskets
  has_many :fruit, :through => :fruit_baskets
  #replicated
end

class Fruit < ActiveRecord::Base
  belongs_to :region
  has_many :fruit_baskets
  has_many :baskets, :through => :fruit_baskets
  #replicated
end

#Join table
class FruitBasket < ActiveRecord::Base
  belongs_to :fruit
  belongs_to :basket
  #replicated
end

class Region < ActiveRecord::Base
  has_one :fruit
  #replicated
end

class Type < ActiveRecord::Base
  
end

class SouthernFruit < Fruit
  self.table_name = 'fruits'  
end

class ModelsHelper
  def self.models
    ["Basket", "Fruit", "FruitBasket", "Region","SouthernFruit", "Type"]
  end 
end


Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
connection_manager-1.0.3 spec/helpers/models_spec_helper.rb
connection_manager-1.0.2 spec/helpers/models_spec_helper.rb
connection_manager-1.0.1 spec/helpers/models_spec_helper.rb
connection_manager-0.3.11 spec/helpers/models_spec_helper.rb
connection_manager-0.3.10 spec/helpers/models_spec_helper.rb
connection_manager-0.3.9 spec/helpers/models_spec_helper.rb
connection_manager-0.3.8 spec/helpers/models_spec_helper.rb
connection_manager-0.3.7 spec/helpers/models_spec_helper.rb
connection_manager-0.3.6 spec/helpers/models_spec_helper.rb
connection_manager-0.3.5 spec/helpers/models_spec_helper.rb
connection_manager-0.3.4 spec/helpers/models_spec_helper.rb
connection_manager-0.3.3 spec/helpers/models_spec_helper.rb
connection_manager-0.3.2 spec/helpers/models_spec_helper.rb
connection_manager-0.3.1 spec/helpers/models_spec_helper.rb
connection_manager-0.3.0 spec/helpers/models_spec_helper.rb