Exception: Octoball::MismatchedShards

Inherits:
StandardError
  • Object
show all
Defined in:
lib/octoball/association_shard_check.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(record, current_shard) ⇒ MismatchedShards

Returns a new instance of MismatchedShards.



7
8
9
10
# File 'lib/octoball/association_shard_check.rb', line 7

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.



5
6
7
# File 'lib/octoball/association_shard_check.rb', line 5

def current_shard
  @current_shard
end

#recordObject (readonly)

Returns the value of attribute record.



5
6
7
# File 'lib/octoball/association_shard_check.rb', line 5

def record
  @record
end

Instance Method Details

#messageObject



12
13
14
# File 'lib/octoball/association_shard_check.rb', line 12

def message
  "Association shard mismatch: record shard is \"#{record.current_shard}\" but current shard is \"#{current_shard}\""
end