lib/sugarcrm/base.rb in sugarcrm-0.9.2 vs lib/sugarcrm/base.rb in sugarcrm-0.9.3

- old
+ new

@@ -165,15 +165,10 @@ operator = value.to_s[/^([<>=]*)(.*)$/,1] operator = '=' if operator.nil? || operator.strip == '' value = $2 # strip the operator from value passed to query value = value.strip[/'?([^']*)'?/,1] - unless column =~ /_c$/ # attribute name ending with _c implies a custom attribute - condition_attribute = "#{self._module.table_name}.#{column}" - else - condition_attribute = column # if setting a condition on a custom attribute (i.e. created by user in Studio), don't add model table name (or query breaks) - end - conditions << "#{condition_attribute} #{operator} \'#{value}\'" + conditions << "#{table_name_for(column)}.#{column} #{operator} \'#{value}\'" } end conditions.join(" AND ") end \ No newline at end of file