-
-
Save matteomanzo/ace9efae2075c116886b39b3d65c7ba3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UffiziIndex < Chewy::Index | |
class << self | |
def index_name(_suggest = nil) | |
"#{Rails.env}_uffizi_#{I18n.locale}" | |
end | |
end | |
define_type( | |
Artwork.includes(:museum), | |
delete_if: -> { translation_for(I18n.locale).nil? } | |
) do | |
field :title, value: -> { title } | |
field :author, value: -> { author } | |
field :formatted_text, value: -> { formatted_text } | |
field :abstract_text, value: -> { abstract_text } | |
field :formatted_renovation, value: -> { formatted_renovation } | |
field :location, value: -> { location } | |
field :technique, value: -> { technique } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment