Wednesday, February 27, 2013

Thursday, February 21, 2013

Rails - Caution on adding new column and assign value to it in the same db migration - reset_column_information

This happens on staging/production rails env.

If you add a new column 'xxx' and assign value to it in the same migration,

Then, you may get error like this: undefined method 'xxx'

You should do a column reset after add column:

e.g. User.reset_column_information


Tuesday, February 19, 2013

selenium ide - AssertConfirmation wildcard *

AssertConfirmation *

Postgresql - show version

psql --version

OR

postgres=# select version();

Postgresql - list users

\du

Git global config

git config --global user.name "Your Name"
git config --global user.email you@example.com

git config --global color.diff auto
git config --global color.status auto
git config --global color.branch auto
git config --global color.log auto

Mac enable root user

How to enable the root user

OS X Lion

  1. From the Apple menu choose System Preferences....
  2. From the View menu choose Users & Groups.
  3. Click the lock and authenticate as an administrator account.
  4. Click Login Options....
  5. Click the "Edit..." or "Join..." button at the bottom right.
  6. Click the "Open Directory Utility..." button.
  7. Click the lock in the Directory Utility window.
  8. Enter an administrator account name and password, then click OK.
  9. Choose Enable Root User from the Edit menu.
  10. Enter the root password you wish to use in both the Password and Verify fields, then click OK.


http://support.apple.com/kb/HT1528?viewlocale=en_US

Monday, February 18, 2013

Edit hosts file on Mac OS

$> sudo vi /private/etc/hosts

115.160.xxx.12 staging
115.160.xxx.11 production

Friday, February 15, 2013

Rails - Solved - relation 'xxx' does not exist

ActiveRecord::StatementInvalid: PGError: ERROR: relation "xxx" does not
exist
LINE 1: DELETE FROM "xxx"
^
: DELETE FROM "xxx"


Solution:

Remove test/fixture/xxx.yml if exists.

Friday, February 1, 2013