This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function specs_to_run(){ | |
git status | grep rb$ | awk '{print $3}' | sed -e "s/^[a-z][a-z]*/spec/g" | sed -e "s/[a-z_]*.rb$/\*/g" | sort | uniq | |
} | |
echo "Need to run these before checking-in:" | |
specs_to_run | |
bundle exec spec `specs_to_run | xargs -L 1000 echo` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PostsController < ActionController::Base | |
def create | |
Post.create(post_params) | |
end | |
def update | |
Post.find(params[:id]).update_attributes!(post_params) | |
end | |
private |