lib/hydra_attribute/hydra_value.rb
def delete_entity_values(entity)
        hydra_attributes = ::HydraAttribute::HydraAttribute.all_by_entity_type(entity.class.model_name)
        hydra_attributes = hydra_attributes.group_by(&:backend_type)
        hydra_attributes.each do |backend_type, attributes|
          table = arel_tables[entity.class.table_name][backend_type]
          where = table['hydra_attribute_id'].in(attributes.map(&:id)).and(table['entity_id'].eq(entity.id))
          arel  = table.from(table)
          connection.delete(arel.where(where).compile_delete, 'SQL')
        end
      end
# Delete all values for current entity
#
# @param [HydraAttribute::HydraEntity] entity
# @return [NilClass]
Delete all values for current entity
Delete all values for current entity
def delete_entity_values(entity)
        hydra_attributes = ::HydraAttribute::HydraAttribute.all_by_entity_type(entity.class.model_name)
        hydra_attributes = hydra_attributes.group_by(&:backend_type)
        hydra_attributes.each do |backend_type, attributes|
          table = arel_tables[entity.class.table_name][backend_type]
          where = table['hydra_attribute_id'].in(attributes.map(&:id)).and(table['entity_id'].eq(entity.id))
          arel  = table.from(table)
          connection.delete(arel.where(where).compile_delete, 'SQL')
        end
      end
def delete_entity_values ( entity ) hydra_attributes = :: HydraAttribute :: HydraAttribute . all_by_entity_type ( entity . class . model_name ) hydra_attributes = hydra_attributes . group_by ( & :backend_type ) hydra_attributes . each do | backend_type , attributes | table = arel_tables [ entity . class . table_name ] [ backend_type ] where = table [ 'hydra_attribute_id' ] . in ( attributes . map ( & :id ) ) . and ( table [ 'entity_id' ] . eq ( entity . id ) ) arel = table . from ( table ) connection . delete ( arel . where ( where ) . compile_delete , 'SQL' ) end end
Delete all values for current entity
Delete all values for current entity
None
NilClass
entity
None