169
170
171
172
173
174
175
176
177
178
179
180
|
# File 'app/models/concerns/acts_as_slugged.rb', line 169
def find(*args)
return super unless args.length == 1
return super if block_given?
reloading = instance_variable_get(:@_effective_reloading)
reloading ||= self.class.instance_variable_get(:@_effective_reloading)
reloading ||= klass.instance_variable_get(:@_effective_reloading) if respond_to?(:klass)
return find_by_id(args.first) if reloading
find_by_slug(args.first) || raise(::ActiveRecord::RecordNotFound.new("Couldn't find #{name} with 'slug'=#{args.first}"))
end
|