search for: charge_id

Displaying 3 results from an estimated 3 matches for "charge_id".

Did you mean: change_id
2006 Jul 14
3
compare two tables and find the difference?
...exist in TableB. TableA and TableB are different but do have one field in common that i am comparing. The tables are not related in anyway. right now I have a find_by_sql query located in a model that looks like this: def self.absent_charges find_by_sql <<-QUERY SELECT sources.charge_id_number, sources.charge_name, sources.offense_level FROM sources LEFT JOIN charges ON sources.charge_id_number = charges.charge_id_number WHERE charges.id IS NULL QUERY end I also need to dedupe what ends up in my final collection after the find_by_sql query, but...
2006 Jul 21
0
[Slightly OT] Need Query Help
...e_name, t.classification AS charge_type, t.classification_level AS charge_level, t.max_fine AS max_fine, t.min_jail_time AS min_jail, t.max_jail_time AS max_jail FROM clients AS c LEFT JOIN matters AS m ON c.id = m.client_id LEFT JOIN charges AS ch ON m.charge_id = ch.id LEFT JOIN charge_types AS t ON ch.charge_type_id = t.id This query retrieves all records for each client. I only want 1 record per client. My models: class Client < ActiveRecord::Base has_and_belongs_to_many :charges, :join_table => ''matters'' ... end...
2008 Mar 12
2
Building a view for a 3 model has_many relationship
...I can enter the hours and those then get posted to my budget_plan model otherwise they just remain blank. I''m doing something similar in another view that works fine with a habtm relationship: <% for charge in @charges %> <div> <p> <%= check_box_tag "user[charge_ids][]", charge.id, @user.charges.include?(charge) %> <%= [charge.project_number, charge.primary_number].join('''') %> - <%= charge.label %> </p> </div> <% end %> That is used to determine which charges a user has access to, so when on the...