GithubHelp home page GithubHelp logo

weedyseadragon / rails-guides-bookstore-models Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 1.0 371 KB

Models used in the ActiveRecord Query Interface Rails Guide. DB migrations and code for seeding example data. Use this repo to run the examples and explore more.

License: MIT License

Ruby 62.09% JavaScript 1.31% HTML 33.29% SCSS 3.31%
rails ruby ruby-on-rails documentation rails-guides

rails-guides-bookstore-models's Introduction

Bookstore Models and Data

These models are actually for a pull request (PR) submitted for the guide so that just one set of models is used for all examples. If the PR is accepted, then these will match up with what the guide says.

Clone this repo to get a very simple Rails app with data that you can use to run the examples in the guide. Use this draft version of the guide; it's the one with my proposed changed (based on the PR). Detailed installation instructions are in the Installation and Use section below.

I created this to help people run and understand the examples in the Rails Guide. I want to save people -- especially novices who are coming up many learning curves at once -- the time and effort needed to figure out exactly how to define and scaffold the models used in the examples.

The goal is to present the models with just enough data so the examples can be run and explored.

This is a first draft. The data does not yet match the example results in the guide exactly.

This is not a complete or efficient Rails application.

The models are defined like they are as examples to illustrate code and concepts from the guide. They would not necessarily use the same definitions and methods in a real world Rails application. Only very minimal layout (view) work was done.

Read more about the details and intention on the home page when you run this as a Rails app. (This is a Rails .html.erb file. It will fully readable when you run this as a Rails application.)

Dependencies

  • Rails 5.2.2
    This may run just fine under earlier 5.x versions of Rails. I have not tested it. I made this to work with the examples in the guide for Rails 5.2.2.

  • Sqlite3
    The Gemfile and config/db are set up to use this, but you can use whatever db you want. There's no code that is db specific. Feel free to change the Gemfile and use the db of your choice)

  • Ruby 2.5.1
    Ruby is a dynamic, open source programming language with a focus on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write.

  • Bootstrap 4.x
    Bootstrap is an open source toolkit for developing with HTML, CSS, and JS. Quickly prototype your ideas or build your entire app with our Sass variables and mixins, responsive grid system, extensive prebuilt components, and powerful plugins built on jQuery.

  • FontAwesome Sass
    A Sass-powered version of FontAwesome for your Ruby projects and plays nicely with Ruby on Rails, Compass, Sprockets, etc.

  • Smarter CSV
    SmarterCSV is a Ruby Gem for smarter importing of CSV Files as Array(s) of Hashes, suitable for parallel processing with Resque or Sidekiq, as well as direct processing with ActiveRecord, Mongoiid.

Installation and Use:

  1. Clone or fork this repo

  2. Ensure your database is configured: check config/database.yml to ensure the settings are right for your system.
    (This uses SqlLite3. If you want to use a different database, be sure to update the gem in the Gemfile and update the database settings.) Read more about setting up your database in the Getting Started Rails Guide

  3. bin/rails db:setup creates the database, runs the migrations, and seeds it with the example data.

  4. Use the rails console to run the examples from the guide.

  5. Run it as a local web application with rails server to see the data in web page views.

Bookstore models

diagram of all of the Bookstore models

Giving Feedback

Is this helpful? How could it be made more helpful? Please post comments and suggestions about the models and using them in the Github repo issues queue. If you have feedback about the guide, please post your comments in the Rails github repo.

MIT License

The authors and contributors have agreed to license all other software under the MIT license, an open source free software license. See the file named LICENSE which includes a disclaimer of warranty.

rails-guides-bookstore-models's People

Contributors

dependabot[bot] avatar jamacku avatar memoht avatar weedyseadragon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

izenik-ez

rails-guides-bookstore-models's Issues

[Bug]: adv labeller fix

Description

that

Documentation

Yes

Diagrams

C4 diagram

Steps to reproduce

that

Screenshots

No response

Code Sample

No response

Setup

Desktop

  • OS and Version: [Windows, Linux, Mac, ...]
  • Browser and Version: [Chrome, Edge, Firefox]

Smartphone

  • Device: [Samsung, iPhone, ...]
  • OS and Version: [Android, iOS, ...]
  • Browser and Version: [Chrome, Safari, ...]

Additional Context

No response

[Bug]:

Description

this is playing around

Does the problem also involve the documentation?

Yes

Please check any and all diagrams invovled.

  • Class diagram
  • Entity Relationship (ER) diagram
  • Flowchart
  • Gantt
  • Git
  • Pie
  • Requirements
  • Sequence
  • State diagram
  • All diagrams

Steps to reproduce

do this, do that

Screenshots

No response

Code Sample

No response

Setup

No response

Additional Context

No response

[Bug]: labels

Description

edit issue again again with doc again again - but now with adv labeller fix

Does the problem also involve the documentation?

Yes

Please check any and all diagrams involved.

Gantt

Steps to reproduce

that

Screenshots

No response

Code Sample

No response

Setup

Desktop

  • OS and Version: [Windows, Linux, Mac, ...]
  • Browser and Version: [Chrome, Edge, Firefox]

Smartphone

  • Device: [Samsung, iPhone, ...]
  • OS and Version: [Android, iOS, ...]
  • Browser and Version: [Chrome, Safari, ...]

Additional Context

No response

[Bug]:

Description

that

Does the problem also involve the documentation?

No

Please check any and all diagrams invovled.

Class diagram

Steps to reproduce

this

Screenshots

No response

Code Sample

No response

Setup

Desktop

  • OS and Version: [Windows, Linux, Mac, ...]
  • Browser and Version: [Chrome, Edge, Firefox]

Smartphone

  • Device: [Samsung, iPhone, ...]
  • OS and Version: [Android, iOS, ...]
  • Browser and Version: [Chrome, Safari, ...]

Additional Context

No response

[Bug]: State diagram styles broken on composites

Does the problem also involve the main documentation? Ex: Choose 'Yes' if the issue is completely or partly about the documentation. Choose 'Yes' if the documentation related to the issue is inaccurate or unclear.

Yes

Please check any and all diagrams invovled.

  • Class diagram
  • Entity Relationship (ER) diagram
  • Flowchart
  • Gantt
  • Git
  • Pie
  • Requirements
  • Sequence
  • State diagram
  • All diagrams

Description

classDef styles don't work on composite states or in composite states

Steps to reproduce

add classDefs within a composite state
apply the classDef styles to states in a composite

Screenshots

No response

Code Sample

No response

Setup

Desktop

  • OS and Version: [Windows, Linux, Mac, ...]
  • Browser and Version: [Chrome, Edge, Firefox]

Smartphone

  • Device: [Samsung, iPhone, ...]
  • OS and Version: [Android, iOS, ...]
  • Browser and Version: [Chrome, Safari, ...]

Additional Context

No response

[Bug]: first adv labeller run

Description

submit an issue

Does the problem also involve the documentation?

Yes

Please check any and all diagrams invovled.

  • Class diagram
  • Entity Relationship (ER) diagram
  • Flowchart
  • Gantt
  • Git
  • Pie
  • Requirements
  • Sequence
  • State diagram
  • All diagrams

Steps to reproduce

do that

Screenshots

No response

Code Sample

No response

Setup

Desktop

  • OS and Version: [Windows, Linux, Mac, ...]
  • Browser and Version: [Chrome, Edge, Firefox]

Smartphone

  • Device: [Samsung, iPhone, ...]
  • OS and Version: [Android, iOS, ...]
  • Browser and Version: [Chrome, Safari, ...]

Additional Context

No response

[Bug]: mermaid bug form - need automatic labels

Description

added dropdown labels

Documentation

Yes

Diagrams

Gantt

Steps to reproduce

add issue

Screenshots

No response

Code Sample

No response

Setup

Desktop

  • OS and Version: [Windows, Linux, Mac, ...]
  • Browser and Version: [Chrome, Edge, Firefox]

Smartphone

  • Device: [Samsung, iPhone, ...]
  • OS and Version: [Android, iOS, ...]
  • Browser and Version: [Chrome, Safari, ...]

Additional Context

No response

[Bug]: more labelling

Description

happen

Does the problem also involve the documentation?

Yes

Please check any and all diagrams invovled.

Git

Steps to reproduce

git label

Screenshots

No response

Code Sample

No response

Setup

Desktop

  • OS and Version: [Windows, Linux, Mac, ...]
  • Browser and Version: [Chrome, Edge, Firefox]

Smartphone

  • Device: [Samsung, iPhone, ...]
  • OS and Version: [Android, iOS, ...]
  • Browser and Version: [Chrome, Safari, ...]

Additional Context

No response

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.