5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-25 01:26:21 +00:00
panel/app/models/metadata_boolean.rb

14 lines
287 B
Ruby
Raw Normal View History

2019-08-20 22:11:10 +00:00
# frozen_string_literal: true
# Implementa valores por sí o por no
class MetadataBoolean < MetadataTemplate
def default_value
false
end
# Convertir el valor que pasemos a boolean
def value
self[:value].present? || document.data.fetch('draft', default_value)
end
end