Giter VIP home page Giter VIP logo

activerecordwithoutrails's Introduction

ActiveRecord without Rails

Simple project with ActiveRecord and ActiveRecord::Tasks

Using gems from Rails 7.0.2.3, Ruby 3.1.1p18, rbenv 1.2.0, and Bundler 2.3.7

I wanted to write a project using ActiveRecord and that morphed into wanting the database rake tasks as well. This project is where I stopped and posted to use as a starting point for such projects.

I don't make any claims that this is correct, good, the best, or anything like that. The Rakefile mostly came from this response on StackOverflow.

The fd.rb was cobbled together from various suggestions on web sites.

This is using PostgreSQL but any database that ActiveRecord supports should work.

Steps to use

  1. Clone the repository
  2. Install Postgres
  3. Create a user in Postgres
  4. bundle install
  5. rake db:create
  6. rake db:migrate
  7. ./fd.rb
  8. psql -c 'select * from files;' files_development
 id |   path    |         created_at         |         updated_at         
----+-----------+----------------------------+----------------------------
  1 | Hobgoblin | 2022-03-30 18:16:36.509568 | 2022-03-30 18:16:36.509568
(1 row)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.