module FriendlyId::ActiveRecord2::SluggedModel::FinderMethods

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

Protected Instance Methods

find_one(id_or_name, options) click to toggle source
Calls superclass method
# File lib/friendly_id/active_record2/slugged_model.rb, line 147
def find_one(id_or_name, options)
  finder = Finders::FinderProxy.new(id_or_name, self, options)
  finder.unfriendly? ? super : finder.find or super
end
find_some(ids_and_names, options) click to toggle source
# File lib/friendly_id/active_record2/slugged_model.rb, line 152
def find_some(ids_and_names, options)
  Finders::FinderProxy.new(ids_and_names, self, options).find
end
validate_find_options(options) click to toggle source

Since Rails goes out of its way to make these options completely inaccessible, we have to copy them here.

# File lib/friendly_id/active_record2/slugged_model.rb, line 158
def validate_find_options(options)
  options.assert_valid_keys([:conditions, :include, :joins, :limit, :offset,
    :order, :select, :readonly, :group, :from, :lock, :having, :scope])
end