Sha256: 54603cb5f91c1031e391752d1af78c191fddb20d8f9915b403d5ab30a3c5d5f5

Contents?: true

Size: 453 Bytes

Versions: 1

Compression:

Stored size: 453 Bytes

Contents

# SurveyGizmo has a bad habit of returning titles in different formats when one is
# requesting all surveys vs. an individual survey.

module SurveyGizmo
  module MultilingualTitle
    extend ActiveSupport::Concern

    included do
      attribute :title, Hash
      alias_method_chain :title=, :multilingual
    end

    def title_with_multilingual=(val)
      self.title_without_multilingual = val.is_a?(Hash) ? val['English'] : val
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
survey-gizmo-ruby-4.1.0 lib/survey_gizmo/multilingual_title.rb