O'Reilly logo

Rails, Angular, Postgres, and Bootstrap by David B. Copeland

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix 2Creating Customer Address Seed Data

This is the full listing for db/seeds.rb needed to create sample address data for all the fake customers we’ve been using to try out Postgres features. This is covered in Chapter 9, Cache Complex Queries Using Materialized Views. It’s included for completeness, but you will find it much easier to work with the source code, which you can download from the book’s website.[120]

Also note that for this code to work, you’ll have to create the State, Address, CustomersBillingAddress, and CustomersShippingAddress models. You’ll also need to create necessary ActiveRecord associations inside the Customer class. Although none of these are needed for Shine to function, they are for the seed data to work. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required