Is there a way to find the default values of a model? That tracks
schema
changes without requiring code changes?
Thanx,
Jeffrey
Is there a way to find the default values of a model? That tracks
schema
changes without requiring code changes?
Thanx,
Jeffrey
ModelName.columns
Each column has an @default
e.g
User.columns.map{|c| c.default}
will give me the defaults for the User model.
Explore a bit in the console.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs