mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-24 18:36:21 +00:00
21 lines
444 B
Ruby
21 lines
444 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
module Metadata
|
||
|
# Mixin para generar atributos indexables
|
||
|
module IndexableConcern
|
||
|
extend ActiveSupport::Concern
|
||
|
|
||
|
included do
|
||
|
# Siempre indexar, a menos que sea un campo privado
|
||
|
#
|
||
|
# @return [Boolean]
|
||
|
def indexable?
|
||
|
true && !private?
|
||
|
end
|
||
|
|
||
|
# Por defecto los valores indexables son el valor actual
|
||
|
alias_method :indexable_values, :value
|
||
|
end
|
||
|
end
|
||
|
end
|