Sha256: c6ca1100a98dde191f69efb21d652c8552c20d206b2c29376950d6d35c6cd054

Contents?: true

Size: 437 Bytes

Versions: 8

Compression:

Stored size: 437 Bytes

Contents

module PushType
  class AssetField < RelationField

    options template: 'asset'

    def relation_class
      PushType::Asset
    end

    on_instance do |object, field|
      object.class_eval do
        define_method(field.relation_name.to_sym) do
          field.relation_class.not_trash.find field.json_value unless field.json_value.blank?
        end unless method_defined?(field.relation_name.to_sym)
      end
    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
push_type_core-0.8.0.beta.2 app/fields/push_type/asset_field.rb
push_type_core-0.8.0.beta.1 app/fields/push_type/asset_field.rb
push_type_core-0.7.0 app/fields/push_type/asset_field.rb
push_type_core-0.7.0.beta.1 app/fields/push_type/asset_field.rb
push_type_core-0.6.0 app/fields/push_type/asset_field.rb
push_type_core-0.6.0.beta.4 app/fields/push_type/asset_field.rb
push_type_core-0.6.0.beta.3 app/fields/push_type/asset_field.rb
push_type_core-0.6.0.beta.2 app/fields/push_type/asset_field.rb