Module: Sequel::Plugins::ExternalId::ClassMethods
- Defined in:
- lib/sequel/plugins/external_id.rb
Instance Method Summary collapse
-
#has_external_id(prefix) ⇒ Object
Called inside a model's body to indicate that this model has an
external_id
that this plugin should manage and what prefix should be used.
Instance Method Details
#has_external_id(prefix) ⇒ Object
Called inside a model's body to indicate that this model has an external_id
that this plugin should manage and what
prefix should be used. Calling this will also alter InstanceMethods#to_s to include this id in the string representation.
40 41 42 43 |
# File 'lib/sequel/plugins/external_id.rb', line 40 def has_external_id(prefix) global_prefix = find_global_prefix @external_id_prefix = RichString.new("#{global_prefix}#{prefix}").to_s_or_nil end |