Friday, June 26, 2015

Playing with Rails 4.2.3

zepho-mac-pro:blog zepho$ rails g scaffold article title
      invoke  active_record
      create    db/migrate/20150626235457_create_articles.rb
      create    app/models/article.rb

  BLAH, BLAH, BLAH

zepho-mac-pro:blog zepho$ rake db:migrate
== 20150626235457 CreateArticles: migrating ===================================
-- create_table(:articles)
   -> 0.0015s
== 20150626235457 CreateArticles: migrated (0.0016s) ==========================

zepho-mac-pro:blog zepho$ rails c
Loading development environment (Rails 4.2.3)
2.2.2 :001 > Article
 => Article (call 'Article.connection' to establish a connection)
2.2.2 :002 > Article.count
   (0.1ms)  SELECT COUNT(*) FROM "articles"
 => 0