5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-07-01 22:36:08 +00:00
panel/app/models/metadata_boolean.rb

14 lines
289 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(name.to_s, default_value)
2019-08-20 22:11:10 +00:00
end
end