1
0
Fork 0
mirror of https://github.com/activerecord-hackery/ransack.git synced 2022-11-09 13:47:45 -05:00

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)