This file contains 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
{:name => "John"}.factorbate :user do |parent| | |
activate! | |
{:body => "Your mom!"}.factorbate :comments, self | |
end |
This file contains 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
grading_period = @context.courses.detect do |course| | |
gp = GradingPeriod.context_find(course, params[:grading_period_id]) and break gp | |
end |
This file contains 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
grading_period = @context.courses.map do |course| | |
GradingPeriod.context_find(course, params[:grading_period_id]) | |
end.compact.first |
This file contains 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 SettingsController < ApplicationController | |
expose(:setting) | |
def update | |
setting.save | |
respond_with setting, :location => settings_path | |
end | |
end |
This file contains 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
ActionDispatch::Routing::PolymorphicRoutes.module_eval do | |
def polymorphic_url_with_hierarchy(record, options={}) | |
record = record.hierarchy if record.respond_to?(:hierarchy) | |
polymorphic_url_without_hierarchy(record, options) | |
end | |
alias_method_chain :polymorphic_url, :hierarchy | |
end | |
ActionView::Helpers::FormHelper.module_eval do | |
def form_for_with_hierarchy(object, *args, &block) |
This file contains 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
source 'http://rubygems.org' | |
gem 'rails', :git => 'git://github.com/rails/rails.git' | |
gem 'arel', :git => 'git://github.com/rails/arel.git' | |
gem 'hike', :git => 'git://github.com/sstephenson/hike.git' | |
gem 'sprockets', :git => 'git://github.com/sstephenson/sprockets.git' | |
gem 'rack', :git => 'git://github.com/rack/rack.git' | |
gem 'rack-ssl', :git => 'git://github.com/josh/rack-ssl.git' | |
gem 'rack-cache', :git => 'git://github.com/rtomayko/rack-cache.git' |
This file contains 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 UploadsController < ApplicationController | |
def show | |
headers['Cache-Control'] = 'public; max-age=600' | |
send_file Rails.root.join("tmp/uploads/#{params[:path]}"), :disposition => 'inline' | |
end | |
end |
This file contains 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
%fieldset.account_info | |
- ["First Name","Last Name","Email","Choose Password"].each do |n| | |
%dl.half | |
%dt | |
%label{:class => cycle("required", "", "required", "required")}=n | |
%dd | |
%input(type="text") |
This file contains 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
# ~/.rvm/hooks/after_cd | |
local dir="$PWD" | |
while [ "$(dirname "$dir")" != "$dir" ]; do | |
if [ -f "$dir/.rbenv-version" ]; then | |
rvm use "$(cat "$dir/.rbenv-version")" | |
break | |
fi | |
dir="$(dirname "$dir")" |
This file contains 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
+__rvm_parse_args:727> [[ -n 4.3.10 ]] | |
+__rvm_parse_args:750> [[ -z '' && -n '' ]] | |
+__rvm_parse_args:752> [[ 0 -eq 1 || -n '' ]] | |
+__rvm_parse_args:20> [[ -n use ]] | |
+__rvm_parse_args:22> rvm_token=use | |
+__rvm_parse_args:24> (( 1 > 0 )) | |
+__rvm_parse_args:26> next_token=1.9.3-preview1@unknown | |
+__rvm_parse_args:27> shift | |
+__rvm_parse_args:32> case use ([[:alnum:]]*|@*) | |
+__rvm_parse_args:36> case use (use) |