5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-15 02:21:42 +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