source:
branches/features/purchaseOrders/grails-app/domain/InventoryLocation.groovy
@
898
Last change on this file since 898 was 622, checked in by , 14 years ago | |
---|---|
File size: 895 bytes |
Line | |
---|---|
1 | import org.codehaus.groovy.grails.commons.ConfigurationHolder |
2 | |
3 | class InventoryLocation { |
4 | |
5 | InventoryStore inventoryStore |
6 | String name |
7 | Boolean isActive = true |
8 | |
9 | static hasMany = [inventoryItems: InventoryItem] |
10 | |
11 | // static belongsTo = [InventoryStore] |
12 | |
13 | static constraints = { |
14 | name(maxSize:50) |
15 | } |
16 | |
17 | String toString() { |
18 | "${this.name}" |
19 | } |
20 | |
21 | static searchable = { |
22 | root false // only index as a component of InventoryItem. |
23 | only = ['name'] |
24 | } |
25 | |
26 | def afterUpdate = { |
27 | // Update the Inventory searchable index, since cascading in searchable-0.5.5 is broken. |
28 | if(ConfigurationHolder.config.appSearchable.cascadeOnUpdate) { |
29 | try { |
30 | InventoryIndexJob.triggerNow(['calledBy':'InventoryLocation afterUpdate{}']) |
31 | } |
32 | catch(e) {log.error e} |
33 | } // if |
34 | } // afterUpdate |
35 | |
36 | } |
Note: See TracBrowser
for help on using the repository browser.