module PrefixedIds::Rails

Adds `has_prefix_id` method

Public Instance Methods

has_prefix_id(prefix, override_find: true, override_param: true, **options) click to toggle source
# File lib/prefixed_ids.rb, line 39
def has_prefix_id(prefix, override_find: true, override_param: true, **options)
  include Attribute
  include Finder if override_find
  include ToParam if override_param
  self._prefix_id = PrefixId.new(self, prefix, **options)

  # Register with PrefixedIds to support PrefixedIds#find
  PrefixedIds.models[prefix.to_s] = self
end