Class: NextSgad::Position
- Inherits:
-
ApplicationRecord
- Object
- ApplicationRecord
- ApplicationRecord
- NextSgad::Position
- Defined in:
- app/models/next_sgad/position.rb
Constant Summary collapse
- INITIAL_LETTER =
"P"
Class Method Summary collapse
-
.map_for_filter ⇒ Object
creates filter data.
-
.map_for_select ⇒ Object
creates filter data.
- .ocupied ⇒ Object
Instance Method Summary collapse
Methods inherited from ApplicationRecord
#create_number, #create_number!
Class Method Details
.map_for_filter ⇒ Object
creates filter data
32 33 34 |
# File 'app/models/next_sgad/position.rb', line 32 def self.map_for_filter [[I18n.t(:everything), :all]] + all.map {|f| [f.name_and_number, f.id]} end |
.map_for_select ⇒ Object
creates filter data
27 28 29 |
# File 'app/models/next_sgad/position.rb', line 27 def self.map_for_select all.map {|f| [f.name_and_number, f.id]} end |
.ocupied ⇒ Object
18 19 20 |
# File 'app/models/next_sgad/position.rb', line 18 def self.ocupied self.where.not(efective_id: nil) end |
Instance Method Details
#name_and_number ⇒ Object
22 23 24 |
# File 'app/models/next_sgad/position.rb', line 22 def name_and_number "#{number} - #{name}" end |