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:
parent
742c638af6
commit
cef7b8ecea
4 changed files with 7 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ module Ransack
|
|||
end
|
||||
|
||||
def valid?
|
||||
attr
|
||||
bound? && attr
|
||||
end
|
||||
|
||||
def type
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -24,7 +24,7 @@ module Ransack
|
|||
end
|
||||
|
||||
def valid?
|
||||
attr
|
||||
bound? && attr
|
||||
end
|
||||
|
||||
def name=(name)
|
||||
|
|
Loading…
Reference in a new issue