app/controllers/products_controller.rb
def add_dependency(dependency)
      unless dependency.blank? || dependency[:product_id].blank?
        @product.dependencies << Product.find(dependency[:product_id])
      end
    end
# Adds new dependency to product (something it depends on)
Adds new dependency to product (something it depends on)
Adds new dependency to product ( something it depends on )
def add_dependency(dependency)
      unless dependency.blank? || dependency[:product_id].blank?
        @product.dependencies << Product.find(dependency[:product_id])
      end
    end
def add_dependency ( dependency ) unless dependency . blank? || dependency [ :product_id ] . blank? @product . dependencies << Product . find ( dependency [ :product_id ] ) end end
Adds new dependency to product (something it depends on)
Adds new dependency to product ( something it depends on )
dependency