New post  Drafts  All posts

How to do cascading deletes with Ruby on Rails

 

Easy and auto-magically done with some Rails goodness:

class User < ActiveRecord::Base
      has_many :user_friends, :dependent => :destroy
end

Deleting a User will then perform a cascaded delete of the dependent user_friends when the User is destroyed.

posted on 2013-04-25 00:00:00 UTC

Topiclocalhost
TagsRails
Read more

 


 

GIT the funk out!

 

So you've changed some code, but aren't sure about it and would like to have some peers take a look without affecting the existing stream of development?

The command-line is your friend.

git checkout -b 2bshared (create a local branch and switch to it)

git status (take a...

posted on 2013-01-27 00:00:00 UTC

Topiclocalhost
TagsGit
Read more

 


 

Timezones, HTML select drop-down, SQL to insert into database

 

Here's a timezone drop-down select for HTML ready to copy/paste into your code.