Activerecord default accessors & unusual requirements
- by JP
I have an ActiveRecord::Base class which needs to have a field that is automatically generated when a new instance is made. How should I go about doing this? By defining an initialize function?
class Thing < ActiveRecord::Base
# 'special' (integer) needs to be set to lowest unused number (above 0)
# considering that random rows will be removed via other processes
end
This is as far as I've got! Any ideas?