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
#this fails | |
lambda { User.create }.should change(User.all, :count).by(+1) | |
#this passes | |
lambda { User.create }.should change(User, :count).by(+1) |
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 Repository | |
include MongoMapper::Document | |
key :follower_ids, Array | |
many :followers, :class_name => 'User', :in => :follower_ids | |
end | |
repository = Repository.first | |
repository.followers # <== Association proxy to the users that follow this repository. |
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
set :application, "ignitious" | |
set :repository, "[email protected]:ethangunderson/ignitious.git" | |
set :ssh_flags, "-p 12345" | |
task :stage do | |
set :deploy_to, "/var/apps/#{application}-stage" | |
set :domain, "[email protected]" | |
end | |
task :production do |
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
<script type='text/javascript'> | |
//<![CDATA[ | |
alert('Whoa! This is Javascript!'); | |
//]]> | |
</script> |
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
:javascript | |
alert('Whoa! This is Javascript!'); |
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
[email protected] do |post| | |
%span.title= post.title | |
.post= post.content | |
%span.author= post.author |
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
<% @posts.each do |post| %> | |
<span class='title'><%= post.title %></span> | |
<div class='post'><%= post.content %></div> | |
<span class='author'><%= post.author %></span> | |
<% 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
!!! | |
%html | |
%head | |
%title Look, we're using Haml! | |
%body | |
#content | |
.post#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
!!! | |
%html | |
%head | |
%title Look, we're using Haml! | |
%body | |
%.div#content | |
%div.post#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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html> | |
<head> | |
<title>Look, we're using Haml!</title> | |
<body> | |
<div id='content'> | |
<div class='post' id='first'></div> | |
</div> | |
</body> | |
</head> |