Exception: Octopus::AssociationShardTracking::MismatchedShards

Inherits:
StandardError
  • Object
show all
Defined in:
lib/octopus/association_shard_tracking.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(record, current_shard) ⇒ MismatchedShards

Returns a new instance of MismatchedShards.



6
7
8
9
# File 'lib/octopus/association_shard_tracking.rb', line 6

def initialize(record, current_shard)
  @record = record
  @current_shard = current_shard
end

Instance Attribute Details

#current_shardObject (readonly)

Returns the value of attribute current_shard.



4
5
6
# File 'lib/octopus/association_shard_tracking.rb', line 4

def current_shard
  @current_shard
end

#recordObject (readonly)

Returns the value of attribute record.



4
5
6
# File 'lib/octopus/association_shard_tracking.rb', line 4

def record
  @record
end

Instance Method Details

#messageObject



11
12
13
14
15
16
17
18
# File 'lib/octopus/association_shard_tracking.rb', line 11

def message
  [
    "Association Error: Records are from different shards",
    "Record: #{record.inspect}",
    "Current Shard: #{current_shard.inspect}",
    "Current Record Shard: #{record.current_shard.inspect}",
  ].join(" ")
end