Module: FriendlyId::ActiveRecordAdapter::FinderMethods

Defined in:
lib/friendly_id/active_record_adapter/finders.rb

Overview

The methods in this module override ActiveRecord’s find_one and find_some to add FriendlyId’s features.

Instance Method Summary collapse

Instance Method Details

#find(*args, &block) ⇒ Object



144
145
146
147
148
149
150
151
# File 'lib/friendly_id/active_record_adapter/finders.rb', line 144

def find(*args, &block)
  finder = Finders::FinderProxy.new(self, *args, &block)
  if finder.multiple?
    finder.find
  else
    finder.unfriendly? ? super : finder.find or super
  end
end