Class: EasyQueryAdapterPresenter
Instance Attribute Summary collapse
#model, #options
Instance Method Summary
collapse
#h, present, presenter_for, register, registered_presenters, #to_model, #update_options
Constructor Details
#initialize(query, view_context = nil, options = {}) ⇒ EasyQueryAdapterPresenter
should be defined in parent in future
7
8
9
10
11
12
13
|
# File 'app/presenters/easy_query_adapter_presenter.rb', line 7
def initialize(query, view_context=nil, options={})
super(query, view_context, options)
@query = query
@page_module = options[:page_module]
end
|
Instance Attribute Details
#page_module ⇒ Object
4
5
6
|
# File 'app/presenters/easy_query_adapter_presenter.rb', line 4
def page_module
@page_module
end
|
#row_limit ⇒ Object
4
5
6
|
# File 'app/presenters/easy_query_adapter_presenter.rb', line 4
def row_limit
@row_limit
end
|
Instance Method Details
#available_outputs ⇒ Object
28
29
30
|
# File 'app/presenters/easy_query_adapter_presenter.rb', line 28
def available_outputs
outputs.available_output_names
end
|
#default_name ⇒ Object
38
39
40
|
# File 'app/presenters/easy_query_adapter_presenter.rb', line 38
def default_name
h.l(self.class.name.underscore, :scope => [:easy_query, :name])
end
|
#entities(options = {}) ⇒ Object
15
16
17
18
|
# File 'app/presenters/easy_query_adapter_presenter.rb', line 15
def entities(options={})
@entities ||= @options[:entities] || h.instance_variable_get(:@entities) end
|
#entity_count(options = {}) ⇒ Object
20
21
22
|
# File 'app/presenters/easy_query_adapter_presenter.rb', line 20
def entity_count(options={})
@entity_count ||= h.instance_variable_get(:@entity_count) || model.entity_count(options)
end
|
#entity_pages ⇒ Object
24
25
26
|
# File 'app/presenters/easy_query_adapter_presenter.rb', line 24
def entity_pages
@options[:entity_pages] || h.instance_variable_get(:@entity_pages)
end
|
#filters_active? ⇒ Boolean
46
47
48
|
# File 'app/presenters/easy_query_adapter_presenter.rb', line 46
def filters_active?
model.filters.any?
end
|
42
43
44
|
# File 'app/presenters/easy_query_adapter_presenter.rb', line 42
def name
@name ||= options[:easy_query_name] || (model.new_record? ? default_name : model.name)
end
|