Class: Action

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/action.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.listObject



21
22
23
24
25
26
27
28
# File 'app/models/action.rb', line 21

def self.list
  all_actions = Hash.new
  all(:include=>:controller).each{|a|
    all_actions[a.controller_name] ||= Hash.new
    all_actions[a.controller_name][a.action_name] = a.id
    }
  all_actions
end

.update_table_for(cont, action_names) ⇒ Object



30
31
32
33
# File 'app/models/action.rb', line 30

def self.update_table_for(cont,action_names)
  remove_deleted_actions(cont, action_names)
  add_new_actions(cont, action_names)
end

Instance Method Details

#<=>(other) ⇒ Object



13
14
15
# File 'app/models/action.rb', line 13

def <=>(other)
    sort_field <=> other.sort_field
end

#sort_fieldObject



17
18
19
# File 'app/models/action.rb', line 17

def sort_field
  [controller_name, action_name]
end