Sha256: e2aaf827277665b51894ab9972828b094115c75766c49bbd4f8db6ddc1ca024b

Contents?: true

Size: 462 Bytes

Versions: 1

Compression:

Stored size: 462 Bytes

Contents

module Fog
  module Associations
    class ManyModels < Default
      def create_setter
        model.class_eval <<-EOS, __FILE__, __LINE__
          def #{name}=(new_#{name})
            associations[:#{name}] = Array(new_#{name})
          end
        EOS
      end

      def create_getter
        model.class_eval <<-EOS, __FILE__, __LINE__
          def #{name}
            Array(associations[:#{name}])
          end
        EOS
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fog-core-1.24.0 lib/fog/core/associations/many_models.rb