Ignore:
Timestamp:
Apr 5, 2012, 5:25:41 PM (5 years ago)
Author:
work@…
Message:
  • improved api service
File:
1 edited

Legend:

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

    r2209 r2210  
    3030    // transactional
    3131    static transactional = false
     32
     33    // characters to split on when converting a string to camelCased format
     34    static camelCaseSeperators = " |-|_"
    3235
    3336    // hasMany keys to ignore when flattening domain data
     
    112115            fields.each { field ->
    113116                // get a camelCased version of the field name
    114                 def name = field.name.split(" ").collect {it[0].toUpperCase() + it.substring(1)}.join('')
     117                def name = field.name.split(camelCaseSeperators).collect {it[0].toUpperCase() + it.substring(1)}.join('')
    115118                    name = name[0].toLowerCase() + name.substring(1)
    116119
Note: See TracChangeset for help on using the changeset viewer.