Workaround for 3.0 not having param_key and fix valid? on attr/sort

This commit is contained in:
Ernie Miller 2011-04-18 13:59:47 -04:00
parent 742c638af6
commit cef7b8ecea
4 changed files with 7 additions and 2 deletions

View File

@ -16,6 +16,7 @@ module Ransack
:id => options[:as] ? "#{options[:as]}_search" : "#{search.klass.to_s.underscore}_search",
:method => :get
}
options[:as] ||= 'q'
options[:html].reverse_merge!(html_options)
options[:builder] ||= FormBuilder

View File

@ -19,7 +19,7 @@ module Ransack
end
def valid?
attr
bound? && attr
end
def type

View File

@ -16,6 +16,10 @@ module Ransack
@klass ||= context.klassify(parent)
end
def bound?
attr_name.present? && parent.present?
end
def reset_binding!
@parent = @attr_name = @attr = @klass = nil
end

View File

@ -24,7 +24,7 @@ module Ransack
end
def valid?
attr
bound? && attr
end
def name=(name)