I am currently trying to use the activerecord gem in Ruby but I’m quite confused on how to use the gem. What’s the difference of ActiveRecord::Base, ActiveRecord::Schema and ActiveRecord::Migration? And when do I use them?
I am currently trying to use the activerecord gem in Ruby but I’m quite
Share
To sum up : AR::Base is the skeleton for a model. Your models usually are classes that derives from this one. AR::Schema is, well, for the schema of your db. You can see what it looks like in the file
db/schema.rb. As for AR::Migration, it’s in the name too : it’s the skeleton for the migration files that you can find indb/migrate. You can check the rails guides & api reference to have more information on them.