21 lines
349 B
Ruby
21 lines
349 B
Ruby
|
module Ransack
|
||
|
module Nodes
|
||
|
module Bindable
|
||
|
|
||
|
attr_accessor :parent, :attr_name
|
||
|
|
||
|
def attr
|
||
|
@attr ||= context.table_for(parent)[attr_name]
|
||
|
end
|
||
|
|
||
|
def klass
|
||
|
@klass ||= context.klassify(parent)
|
||
|
end
|
||
|
|
||
|
def reset_binding!
|
||
|
@parent = @attr_name = @attr = @klass = nil
|
||
|
end
|
||
|
|
||
|
end
|
||
|
end
|
||
|
end
|