LoginSignup
1
1

More than 5 years have passed since last update.

Rails Core Dev Memo

Last updated at Posted at 2013-02-09

rails-dev-box

  • $ vagrant suspend suspend VM
  • $ vagrant resume hack again
  • $ vagrant halt shut down
  • $ vagrant up boot it again
  • $ vagrant status check status
  • $ vagrant destroy # DANGER: all is gone wipe the virtual machine from the disk destroying all its contents

Tests

  • Runnning single test separately
    • $ ARCONN=sqlite3 ruby -Itest test/cases/associations/has_many_associations_test.rb -n test_something_working
    • --name "full name with spaces" or --name /with/ when test 'something' do … end syntax
    • -v after the file name will output the test name
  • Run tests
    • $ bundle exec rake test
  • Run sqlite tests(activerecord)
    • $ bundle exec rake test_sqlite3
    • Others are test_mysql, test_mysql2, test_postgresql
  • Run tests without warnings
    • $ RUBYOPT=-W0 bundle exec rake test

ActiveRecord

Thread

wtf is it :P

::Persistence

  • private method, update_record and create_update are the key methods

::Scoping

::Default

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1