How to use activerecord in a library?
31-Mar-2022 1424
Recently, I wanted to use ActiveRecord in a library, not in a Rails app or a Rails engine. After doing a bit of Googling, I found this excellent tutorial. While it covered the basics, such as connecting to the database, defining a model and a migration, it missed a few things. In this blog post I will provide a more detailed example of how to connect to a default or arbitrary database, “connect” multiple models to the database, and run a directory of migrations if they have not already been ran.
How to use activerecord in a library? #ruby #rubydeveloper #rubyonrails #activerecord #library? #activerecord #library? https://rubyonrails.ba/link/how-to-use-activerecord-in-a-library