Sha256: a2793f477731166a371a9457e69aac088f740e03517b9c68dedf12afd26d9b68

Contents?: true

Size: 651 Bytes

Versions: 1

Compression:

Stored size: 651 Bytes

Contents

require 'copy_tuner_client/copyray'

begin
  require "simple_form"
rescue LoadError
end

if defined?(SimpleForm)
  module SimpleForm::Components::Labels
    protected
    def label_translation_with_copyray_comment
      source = label_translation_without_copyray_comment

      attributes_scope = "#{object.class.i18n_scope}.attributes"
      defaults = object.class.lookup_ancestors.map do |klass|
        "#{attributes_scope}.#{klass.model_name.i18n_key}.#{reflection_or_attribute_name}"
      end

      CopyTunerClient::Copyray.augment_template(source, defaults.shift)
    end
    alias_method_chain :label_translation, :copyray_comment
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
copy_tuner_client-0.1.1.beta5 lib/copy_tuner_client/simple_form_extention.rb