mirror of
https://github.com/Threnklyn/Klaus.git
synced 2026-05-18 12:13:28 +02:00
13 lines
188 B
Ruby
13 lines
188 B
Ruby
module ToDropdown
|
|
extend ActiveSupport::Concern
|
|
|
|
def to_option
|
|
[name, id]
|
|
end
|
|
|
|
module ClassMethods
|
|
def to_dropdown
|
|
all.order(:name).map(&:to_option)
|
|
end
|
|
end
|
|
end |