Displaying 1 result from an estimated 1 matches for "student_number".
2010 Feb 04
3
Checking column in table to see if value exists?
...''t, then update the existing record with the specified value
and if it does exist increment by 1 from the previous incrementation of
the value. And do it using the model (or controller if it''s unable to be
done in the model). Something like this:
def test!
update_attributes :student_number =>
if student_number.array.include?(2001)
Student.student_number.first(:order => "student_number
DESC").student_number + 1
else
2001
end
end
Can this be done?
Now this immediately returns a nil.array error, but what I''m more
concerned about is...