Displaying 2 results from an estimated 2 matches for "charge_type_id".
2006 Jul 21
0
[Slightly OT] Need Query Help
I need to select 1 record from each client. This record has the charge
with the most severe charge type (lowest charge_type_id). How do I go
about this?
I have been using a find_by_sql query out of the client.rb that looks
like:
SELECT c.f_name AS f_name, c.l_name AS l_name, c.gender AS gender,
c.race AS race, c.dob AS dob, c.address AS address, c.city AS
city,
c.state AS state, c.zipcode AS zipcode,...
2006 Jul 14
3
compare two tables and find the difference?
...number]", charge.charge_id_number
%><%= charge.charge_id_number %></td>
<td><%= text_field_tag "charge[#{charge_counter}][name]",
charge.charge_name, :size => 50 %></td>
<td><%= collection_select ''charge'', ''charge_type_id'', @charge_types,
''id'', ''full_name'' %></td>
</tr>
the relevant part of the controller:
class ImportController < ApplicationController
...
def update_charges
@new_charges = Source.absent_charges
@charge_types = ChargeType.fi...