I am building a application in which i have a model user, In the first version of the application there will be no mobile number column for the users in the later version it must be present, is there any way to add versioning to models so that active record validation can be written to a particular version.
Keep the old users intact and subclass the new users. Since ActiveRecord supports Single Table Inheritance, the database will have a new column called type
to distinguish between old a new users. And your validation will be only on the new users.
Keeping them as different classes mirrors your business model that the old users do not have a mobile phone number.