Skip to content

Commit

Permalink
fixed some README typos
Browse files Browse the repository at this point in the history
  • Loading branch information
nakajima committed Oct 29, 2008
1 parent 5cf53a1 commit 4206045
Showing 1 changed file with 33 additions and 26 deletions.
59 changes: 33 additions & 26 deletions README.textile
Expand Up @@ -18,35 +18,42 @@ too, I'll leave you to figure it out though)


Then in your specs: Then in your specs:


describe "acts_as_gilmore_girls" do <pre>
before(:each) do describe "acts_as_gilmore_girls" do
build_model :nerds do before(:each) do
text :omg_omg_bio build_model :nerds do
string :name text :omg_omg_bio
string :favorite_scene string :name
def awesome?(show_name) string :favorite_scene
show_name == "Gilmore Girls" has_many
end
validates_presence_of :favorite_scene

def awesome?(show_name)
show_name == "Gilmore Girls"
end end

end end

it "should require favorite scene" do
nerd = Nerd.new :favorite_scene => nil
nerd.should_not be_valid
nerd.errors.on(:favorite_scene).should_not be_nil
end

it "should think gilmore girls is awesome"
nerd = Nerd.new
nerd.awesome?("Gilmore Girls").should be_true
end

it "has other stuff" do
# ETC!
end
end end

it "should require favorite scene" do
nerd = Nerd.new :favorite_scene => nil
nerd.should_not be_valid
nerd.errors.on(:favorite_scene).should_not be_nil
end

it "should think gilmore girls is awesome"
nerd = Nerd.new
nerd.awesome?("Gilmore Girls").should be_true
end

it "has other stuff" do
# ETC!
end
end
</pre>


The @build_model@ method allows you to build an ActiveRecord on The @build_model@ method allows you to build an ActiveRecord model on
the fly. It takes a block where you can specify columns and methods. the fly. It takes a block where you can specify columns and methods.


h4. Single Table Inheritance h4. Single Table Inheritance
Expand Down Expand Up @@ -89,4 +96,4 @@ NOTE
Despite the above example, watching Gilmore Girls doesn't make you Despite the above example, watching Gilmore Girls doesn't make you
a nerd. Probably. a nerd. Probably.


(c) Copyright 2008 Pat Nakajima. All Rights Reserved. (c) Copyright 2008 Pat Nakajima. All Rights Reserved.

0 comments on commit 4206045

Please sign in to comment.