Skip to content

Commit

Permalink
All tests now passing with AR 3.
Browse files Browse the repository at this point in the history
  • Loading branch information
norman committed Mar 26, 2010
1 parent 89ae04e commit 0ab4d33
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 21 deletions.
18 changes: 0 additions & 18 deletions lib/friendly_id/acktive_record/finders.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,24 +148,6 @@ def find(*args, &block)
end
end

# protected
#
# def find_one(id_or_name, options)
# finder = Finders::FinderProxy.new(id_or_name, self, options)
# finder.unfriendly? ? super : finder.find or super
# end
#
# def find_some(ids_and_names, options)
# Finders::FinderProxy.new(ids_and_names, self, options).find
# end
#
# # Since Rails goes out of its way to make these options completely
# # inaccessible, we have to copy them here.
# def validate_find_options(options)
# options.assert_valid_keys([:conditions, :include, :joins, :limit, :offset,
# :order, :select, :readonly, :group, :from, :lock, :having, :scope])
# end

end

end
Expand Down
2 changes: 1 addition & 1 deletion lib/friendly_id/acktive_record/slugged_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def find_options
end

def raise_scoped_error
scope_message = options[:scope] || "expected, but none given"
scope_message = scope || "expected, but none given"
message = "%s, scope: %s" % [@error.message, scope_message]
raise ::ActiveRecord::RecordNotFound, message
end
Expand Down
6 changes: 4 additions & 2 deletions lib/friendly_id/finders.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def initialize(ids, model_class, options={})
self.ids = ids
self.options = options
self.model_class = model_class
self.scope = options[:scope]
self.scope = options.delete :scope
end

def method_missing(*args, &block)
Expand Down Expand Up @@ -67,7 +67,9 @@ def ids=(ids)
alias :id= :ids=

def scope=(scope)
@scope = scope.to_param unless scope.nil?
unless scope.nil?
@scope = scope.respond_to?(:to_param) ? scope.to_param : scope.to_s
end
end
end

Expand Down

0 comments on commit 0ab4d33

Please sign in to comment.