Class: Marty::ScriptGrid
- Inherits:
-
Grid
- Object
- Netzke::Grid::Base
- Grid
- Marty::ScriptGrid
show all
- Defined in:
- app/components/marty/script_grid.rb
Constant Summary
Constants included
from Permissions
Permissions::ALL_ROLES, Permissions::REQ_ROLES
Instance Method Summary
collapse
Methods inherited from Grid
#child_components, #class_can?, #configure_form_window, #get_json_sorter, #has_search_action?, #initialize, #linked_components
#can_perform_action?, #can_perform_actions, #current_user_roles, #has_any_perm?, #has_marty_permissions
Constructor Details
This class inherits a constructor from Marty::Grid
Instance Method Details
8
9
10
11
12
13
14
15
16
|
# File 'app/components/marty/script_grid.rb', line 8
def configure(c)
super
c.model = "Marty::Script"
c.multi_select = false
c.attributes ||= [:name, :created_dt, :tag]
c.title ||= I18n.t('scripts', default: "Scripts")
c.store_config.merge!({sorters: [{property: :name, direction: 'ASC'}]})
end
|
#default_bbar ⇒ Object
84
85
86
|
# File 'app/components/marty/script_grid.rb', line 84
def default_bbar
[:add_in_form, :delete]
end
|
88
89
90
|
# File 'app/components/marty/script_grid.rb', line 88
def
[]
end
|
92
93
94
|
# File 'app/components/marty/script_grid.rb', line 92
def default_form_items
[:name]
end
|
#get_records(params) ⇒ Object
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'app/components/marty/script_grid.rb', line 18
def get_records(params)
begin
ts = Marty::Tag.map_to_tag(root_sess[:selected_tag_id]).created_dt
ts = Mcfly.normalize_infinity(ts)
rescue
ts = 'infinity'
end
tb = model.table_name
model.where("#{tb}.obsoleted_dt >= ? AND #{tb}.created_dt < ?",
ts, ts).scoping do
super
end
end
|