Displaying 1 result from an estimated 1 matches for "customer_number_sequences".
2006 Jan 11
3
How do you do a custom sql call in rails?
...r to the account that created the customer (see schema snip
below).
I need to have a way of generating the next available number for that
particular account. I have used a custom sequence table to do this type of
thing in the past. The sql I''ve used is the following:
begin
update customer_number_sequences set current_number = current_number + 1
where account_id = 12345
select current_number from customer_number_sequences where account_id =
12345
commit
So my question is how if it all can I integrate this into my @customer.save
call???
Should I add a before_create method to the Customer model an...