GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: DataMapper Adapters
Homepage: http://www.yehudakatz.com
Clone URL: git://github.com/wycats/dm-adapters.git
Fixes the field naming convention for read
hassox (author)
Tue Jul 01 06:01:48 -0700 2008
commit  5826e2ac800dcb63626a2be1921d21f2a0d98db1
tree    b8cdd191d0ffd6389c3772db02785077cc582a40
parent  f58aee158d7e691d23257a92cb7b9ea1378dee35
...
127
128
129
130
 
131
132
133
...
127
128
129
 
130
131
132
133
0
@@ -127,7 +127,7 @@ module DataMapper
0
 
0
         conditions = query.conditions.map {|c| SQL.from_condition(c, repository)}.compact.join(") AND (")
0
       
0
- query_string = "SELECT #{query.fields.map {|f| f.field}.join(", ")} from #{query.model.storage_name(repository.name)}"
0
+ query_string = "SELECT #{query.fields.map {|f| @field_naming_convention.call(f.field)}.join(", ")} from #{query.model.storage_name(repository.name)}"
0
         query_string << " WHERE (#{conditions})" unless conditions.empty?
0
         query_string << " ORDER BY #{SQL.order(query.order[0])}" unless query.order.empty?
0
         query_string << " LIMIT #{query.limit}" if query.limit

Comments

    No one has commented yet.