Class: Fog::Associations::OracleManyModels

Inherits:
OracleDefault
  • Object
show all
Defined in:
lib/fog/oracle/models/associations.rb

Instance Method Summary collapse

Methods inherited from OracleDefault

#create_getter

Instance Method Details

#create_setterObject



33
34
35
36
37
38
39
40
41
42
43
# File 'lib/fog/oracle/models/associations.rb', line 33

def create_setter
  model.class_eval <<-EOS, __FILE__, __LINE__
    def #{name}=(new_#{name})
      return if new_#{name}.nil?
      collection = service.send(self.class.associations[:#{name}])
      associations[:#{name}] = Array(new_#{name}).map do |association|
        collection.new(association)
      end
    end
  EOS
end