Skip to content

Estebes10/Inframex

Repository files navigation

Inframex

Application settings:

INSTALL POSTGRESQL CHANGE database Configuration file in config/database.yml with YOUR CREDENTIALS

  • Ruby version

    • 2.5.1
  • Rails version

    • 5.2.1
  • System dependencies

    • rspec-rails - Testing framework. Rspec
    • factory_girl_rails - Factory pattern for building objects
    • shoulda_matchers - Provides RSpec with additional matchers.
    • database_cleaner - Gem to clean our test database to ensure a clean state in each test suite.
    • faker - A library for generating fake data.

Configuration

  • Database creation AFTER CLONE REPOSITORY

    • Prepare database (Create database, load schema and initialize seeds)
      rails db:setup
  • Database initialization

    • Load schema and initialize seeds
      rails db:schema:load
      rails db:seed
  • Reset database

    • Reset database
      rails db:reset -> rails db:drop db:setup.
    • Update schema file
      rails db:schema:dump
      rails db:migrate:reset
  • Prepare database for test

    rails db:test:prepare

Run tests

  • How to run the test suite
      bundle exec rspec spec/ -fd --order rand

## Basic commands

generate model (model name in capital letter)

  rails g model NameModel attribute1:type attribute2:type ...
  • this will create a model, migration, factory for model and model test file.
  • example
  rails g model Blog name:string status:boolean due_date:date days:integer

generate migration to create 1 to n relationship

rails g migration AddConceptToJobs concept:references

run migration to create table in database or update existing tables

  rails db:migrate

rollback migration

rails db:rollback

generate controller with cli (model name in plural) and optional actions (index, show, new, update, destroy)

rails g controller Blogs index show

access to rails console

rails c

run server

rails server

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •