ActiveRecord has a nice little calculation helper method called maximum that can be used to find the maximum value for a column in the database. If you’ve added the ability to sort data, this comes in handy when you want to insert a new record at the end. However, if you are creating [...]
Archive for July, 2008
ActiveRecord.maximum
Posted in RubyOnRails on July 30, 2008 | Comments Off
Generate Rails project for prior version
Posted in Quick Tips, RubyOnRails on July 14, 2008 | Comments Off
In the event you have multiple versions of the Rails gem and want to generate an older version, you can do the following:
rails _2.0.2_ myapp
This will create a new myapp directory with Rails version 2.0.2.
Git commands
Posted in git on July 8, 2008 | Comments Off
A collection of git commands from various git related posts:
Handling a pull request:
# go to your project directory first
# add account/project
git remote add <account> git://github.com/<account>/<project>.git
# create a new branch
git checkout -b <account>/<branch>
# push new branch to remote repo
# ** checkout new branch first. must be ‘on’ new branch
git push origin <new_branch_name>:refs/heads/<new_branch_name>
# information
git show <branch_name> [...]
