Skip to content

Instantly share code, notes, and snippets.

View Evan-M's full-sized avatar

Evan Marell Evan-M

View GitHub Profile
@Evan-M
Evan-M / post-merge
Last active October 13, 2015 16:27
Git post-merge hook for Rails migrations and bundle
#!/bin/sh
diff=`git diff --name-only HEAD@{1} HEAD`
migrate=`expr "$diff" : ".*db/migrate.*"`
bundle=`expr "$diff" : ".*Gemfile*"`
composer=`expr "$diff" : ".*composer*"`
if [ ! "$bundle" -eq 0 ]
then
@Evan-M
Evan-M / dci-rest-creation.rb
Created January 28, 2012 16:55 — forked from mikepack/dci-rest-creation.rb
DCI + Rails new and create
# ---role
module BookManager
def create_book(attrs)
self.books.create! attrs
end
def update_book(book_id,attrs)
book = self.books.find(book_id)
book.update_attributes attrs