Sha256: 4b863390e8de57427751c15e2161156e76900dd70f39f3190ca52241d4cee3f8

Contents?: true

Size: 539 Bytes

Versions: 12

Compression:

Stored size: 539 Bytes

Contents

module Apidae
  module OverriddenFields

    # Note : add non-localized fields that can be overridden in aspects (openings, rates etc...)
    LOCALIZED_FIELDS.each do |f|
      define_method f do
        if @obj_version == DEFAULT_VERSION
          val = (super() || {})[@locale]
          val ||= (super() || {})[DEFAULT_LOCALE] if root_obj_id.nil?
          val
        else
          v = in_version(@obj_version)
          v ? (v.in_locale(@locale).send(f) || super()[@locale]) : super()[@locale]
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
apidae-0.9.14 app/models/apidae/overridden_fields.rb
apidae-0.9.13 app/models/apidae/overridden_fields.rb
apidae-0.9.12 app/models/apidae/overridden_fields.rb
apidae-0.9.11 app/models/apidae/overridden_fields.rb
apidae-0.9.10 app/models/apidae/overridden_fields.rb
apidae-0.9.9 app/models/apidae/overridden_fields.rb
apidae-0.9.8 app/models/apidae/overridden_fields.rb
apidae-0.9.7 app/models/apidae/overridden_fields.rb
apidae-0.9.6 app/models/apidae/overridden_fields.rb
apidae-0.9.5 app/models/apidae/overridden_fields.rb
apidae-0.9.4 app/models/apidae/overridden_fields.rb
apidae-0.9.3 app/models/apidae/overridden_fields.rb