Method: Switchman::ActiveRecord::AttributeMethods#global_attribute
- Defined in:
- lib/switchman/active_record/attribute_methods.rb
#global_attribute(attr_name) ⇒ Object
289 290 291 292 293 294 295 |
# File 'lib/switchman/active_record/attribute_methods.rb', line 289 def global_attribute(attr_name) if self.class.sharded_column?(attr_name) ::Switchman::Shard.global_id_for(attribute(attr_name), shard) else attribute(attr_name) end end |