Skip to content
This repository has been archived by the owner on Oct 9, 2019. It is now read-only.

Commit

Permalink
properly handle options given to has_relational_scope
Browse files Browse the repository at this point in the history
  • Loading branch information
zacheryph committed Feb 20, 2009
1 parent a0abf2d commit 4c415ca
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/suid_bit/relational_scope.rb
Expand Up @@ -7,8 +7,7 @@ def self.included(klass)
end

module ClassMethods
def has_relational_scope(relation, *args)
options = args.is_a?(Hash) ? args.pop : {}
def has_relational_scope(relation, options = {})
klass = (options[:class_name] ? options[:class_name] : relation).to_s.classify.constantize
prefix = options[:prefix] || relation.to_s

Expand Down

0 comments on commit 4c415ca

Please sign in to comment.