module Siphon::Scope
Public Instance Methods
ransack(attr, type = nil)
click to toggle source
# File lib/siphon/scope.rb, line 94 def ransack(attr, type = nil) type.nil? ? attribute(attr) : attribute(attr, type) @ransack_set << attr end
ransack_set()
click to toggle source
# File lib/siphon/scope.rb, line 81 def ransack_set @ransack_set end
scope(attr, type = nil)
click to toggle source
# File lib/siphon/scope.rb, line 89 def scope(attr, type = nil) type.nil? ? attribute(attr) : attribute(attr, type) @siphon_set << attr end
siphon_set()
click to toggle source
# File lib/siphon/scope.rb, line 85 def siphon_set @siphon_set end
siphonize(model, model_name: nil, table_name: nil)
click to toggle source
# File lib/siphon/scope.rb, line 73 def siphonize(model, model_name: nil, table_name: nil) name = model_name || "#{model}Search" self.model_name= ActiveModel::Name.new(self, nil, name) self.table_name= model.table_name @ransack_set ||= [] @siphon_set ||= [] end