Changeset 401


Ignore:
Timestamp:
Feb 23, 2010, 12:21:28 PM (14 years ago)
Author:
gav
Message:

Small improvement to AddressService checkForOwner().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/services/AddressService.groovy

    r397 r401  
    5656
    5757    private checkForOwner(params) {
    58         def manufacturerInstance
    59         def supplierInstance
    60         def personInstance
    61         def siteInstance
    6258
    6359        if(params.manufacturer?.id)
    64             manufacturerInstance = Manufacturer.get(params.manufacturer.id)
     60            return Manufacturer.exists(params.manufacturer.id)
    6561        if(params.supplier?.id)
    66             supplierInstance = Supplier.get(params.supplier.id)
     62            return Supplier.exists(params.supplier.id)
    6763        if(params.person?.id)
    68             personInstance = Person.get(params.person.id)
     64            return Person.exists(params.person.id)
    6965        if(params.site?.id)
    70             siteInstance = Site.get(params.site?.id)
     66            return Site.exists(params.site.id)
    7167
    72         if(!manufacturerInstance && !supplierInstance && !personInstance && !siteInstance)
    73             return false
    74 
    75         return true
     68        return false
    7669    }
    7770
Note: See TracChangeset for help on using the changeset viewer.