Sha256: 73c89787a533fe42f9801b2e20252c36cf70f9949f5d71faf7d48d1b0041fa23

Contents?: true

Size: 562 Bytes

Versions: 75

Compression:

Stored size: 562 Bytes

Contents

module EgovUtils
  class AddressSchema < EgovUtils::EngineSchema

    def attribute_for_column(col)
      case col.name
      when 'district'
        EgovUtils::District.new
      when 'region'
        EgovUtils::Region.new
      else
        super
      end
    end

    def main_attribute_name
      'full_address'
    end

    def path
      'to_s'
    end

    def initialize_available_attributes
      @available_attributes ||= []
      @available_attributes << EgovUtils::FullAddress.new(model, 'full_address', schema: self)
      super
    end

  end
end

Version data entries

75 entries across 75 versions & 1 rubygems

Version Path
egov_utils-1.5.0.alpha16 app/schemas/egov_utils/address_schema.rb
egov_utils-1.5.0.alpha15 app/schemas/egov_utils/address_schema.rb
egov_utils-1.5.0.alpha14 app/schemas/egov_utils/address_schema.rb
egov_utils-1.5.0.alpha13 app/schemas/egov_utils/address_schema.rb
egov_utils-1.5.0.alpha12 app/schemas/egov_utils/address_schema.rb
egov_utils-1.5.0.alpha11 app/schemas/egov_utils/address_schema.rb
egov_utils-1.5.0.alpha10 app/schemas/egov_utils/address_schema.rb
egov_utils-1.5.0.alpha9 app/schemas/egov_utils/address_schema.rb
egov_utils-1.5.0.alpha8 app/schemas/egov_utils/address_schema.rb
egov_utils-1.5.0.alpha7 app/schemas/egov_utils/address_schema.rb
egov_utils-1.5.0.alpha6 app/schemas/egov_utils/address_schema.rb
egov_utils-1.5.0.alpha5 app/schemas/egov_utils/address_schema.rb
egov_utils-1.5.0.alpha4 app/schemas/egov_utils/address_schema.rb
egov_utils-1.4.5 app/schemas/egov_utils/address_schema.rb
egov_utils-1.4.4 app/schemas/egov_utils/address_schema.rb
egov_utils-1.5.0.alpha3 app/schemas/egov_utils/address_schema.rb
egov_utils-1.5.0.alpha2 app/schemas/egov_utils/address_schema.rb
egov_utils-1.5.0.alpha1 app/schemas/egov_utils/address_schema.rb
egov_utils-1.4.3 app/schemas/egov_utils/address_schema.rb
egov_utils-1.4.2 app/schemas/egov_utils/address_schema.rb