D'oh. class_attribute FAIL.

This commit is contained in:
Ernie Miller 2011-06-10 09:33:02 -04:00
parent ffb08e08a4
commit 2cfa803111
2 changed files with 2 additions and 4 deletions

View File

@ -5,7 +5,7 @@ module Ransack
def self.extended(base)
alias :search :ransack unless base.method_defined? :search
base.instance_eval do
base.class_eval do
class_attribute :_ransackers
self._ransackers ||= {}
end
@ -16,7 +16,7 @@ module Ransack
end
def ransacker(name, opts = {}, &block)
Ransacker.new(self, name, opts, &block)
self._ransackers = _ransackers.merge name.to_s => Ransacker.new(self, name, opts, &block)
end
def ransackable_attributes(auth_object = nil)

View File

@ -14,8 +14,6 @@ module Ransack
@callable = opts[:callable] || block ||
(@klass.method(name) if @klass.respond_to?(name)) ||
proc {|parent| parent.table[name]}
@klass._ransackers[name.to_s] = self
end
def attr_from(bindable)