Ignore:
Timestamp:
Nov 25, 2010, 9:08:43 AM (14 years ago)
Author:
gav
Message:

Domain change: as per ticket #96 - Remove unused fields from InventoryItem?.
Removed InventoryItem?.alternateItems.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/domain/InventoryItem.groovy

    r719 r720  
    2323    }
    2424
    25     static hasMany = [alternateItems: InventoryItem,
    26                                     spareFor: Asset,
     25    static hasMany = [spareFor: Asset,
    2726                                    inventoryMovements: InventoryMovement,
    2827                                    alternateSuppliers: Supplier]
     
    6059    }
    6160
    62     def afterInsert = {
    63         addReverseAlternateItems()
    64     }
    65 
    66     /**
    67     * Add reverse alternateItem references.
    68     */
    69     def addReverseAlternateItems() {
    70         this.alternateItems.each() {
    71             if( !it.alternateItems?.contains(this) )
    72                 it.addToAlternateItems(this)
    73         }
    74     }
    75 
    76     /**
    77    * Remove all reverse alternateItem references.
    78     * On update: reverse alternateItem handling must be done in the
    79     * service class since the before assignment alternateItems are required.
    80     */
    81     def removeReverseAlternateItems(alternateItems = this.alternateItems) {
    82         alternateItems.each() {
    83             it.removeFromAlternateItems(this)
    84         }
    85     }
    86 
    8761}
Note: See TracChangeset for help on using the changeset viewer.