Today I Learned How to Create a React-Rails App

A working example can be found here in the Saturday MP Examples GitHub.

First thing you need to do is create a basic Rails app as outlined in my previous post.  My setup is the same as creating Rails app: Ubuntu 18.04 LTS host using Docker to containerize my development environment.

Once your basic Rails app is up and running you can add React.  This example uses React-Rails.  First, you need to update the Docker file to install Node JS and Yarn.  Open up the DockerFile and change it so it looks like the below.

[Read More]

Today I Learned how to Generate a ERD for Rails Application

Back in the day Rails apps didn’t add foreign keys to database tables.  Believe it or not this was a feature not a bug.  The idea was that you shouldn’t “repeat” the relationship between you models in the code and in the database.  It wasn’t until Rails 4.2 that support was added for foreign keys.  

As you can probably guess I think this was a mistake.  If you have worked with a database without any foreign key constraints you quickly run into data integrity issues.  I don’t care how careful you think you are you will eventually screw up.  If not you then another person or application will corrupt your data.  Line items not attached to an order, address without customers, cats and dogs living together, etc.

[Read More]

Today I Learned how to Create Rails Docker Container Without Ruby Installed

I was curious to see if I could create a Docker container for a new Rails project without having Ruby or Rails installed on the host machine.  To do this I created a new Ubuntu 18 virtual machine with the bare minimum installed for the OS.  I also install Docker, RubyMine, and DataGrip.

Initially I was hoping I could just create the new project inside RubyMine.  Unfortunately I couldn’t get it working.  As you will see setting up the initial Docker container requires more then just running the “docker-compose up” command.

[Read More]

Today I Learned how to Run SQL Server on a Mac using Docker

Working on my code example for my upcoming SQL Saturday 710 talk I ran into a performance issue.  My laptop is an older MacBook Pro and I was trying to run my example on a Windows virtual machine…

What is SQL Saturday?  Good question.

SQL Saturday Logo

SQL Saturday is an entire day of talks, training, and socializing about databases and data storage.  SQL Saturday 710 is on May 5th in Edmonton but there are SQL Saturdays, with different numbers at the end, all around the world on different dates.

[Read More]

Today I Learned how to Run SpinRite on a UEIF Motherboard

I have a Synology NAS that has starting acting up.  By acting up I mean I can’t connect to it and it requires a unplugged reboot to fix it.  Power button no work.  After doing some detective work I’m not sure if the problem is with the hard drives or the Synology it’s self.

To help me narrow down the problem I thought I’d run SpinRite which is a hard drive diagnostic tool.  I heard about SpinRite from the Security Now podcast.  It was created by Steve Gibson, one of the hosts and they talk about it’s virtues often on the podcast.

[Read More]