Sha256: e5fad5d54000125cd88df3a393f953d0d86597c198136e9908d3f0bb9b33f4e4

Contents?: true

Size: 1008 Bytes

Versions: 4

Compression:

Stored size: 1008 Bytes

Contents

blueprint :apple do
  Fruit.create! :species => 'apple'
end

blueprint :many_apples => [:apple, :apple, :apple]

blueprint :bananas_and_apples => :apple do
  @banana = Fruit.create! :species => 'banana'
end

blueprint :orange do
  Fruit.create! :species => 'orange'
end

blueprint :fruit => [:apple, :orange] do
  [@orange, @apple]
end

blueprint :bananas_and_apples_and_oranges => [:bananas_and_apples, :orange] do
  @fruit = [@orange, @apple, @banana]
end

blueprint :cherry do
  Fruit.create! :species => 'cherry', :average_diameter => 3
end

blueprint :big_cherry => :cherry do
  Fruit.create! :species => @cherry.species, :average_diameter => 7
end

blueprint :cherry_basket => [:big_cherry, :cherry] do
  [@cherry, @big_cherry]
end

blueprint :parent_not_existing => :not_existing

Tree.blueprint :oak, :name => 'Oak', :size => 'large'

blueprint :pine do
  @the_pine = Tree.blueprint :name => 'Pine', :size => 'medium'
end

Fruit.blueprint(:acorn, :species => 'Acorn', :tree => :@oak).depends_on(:oak)

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
blueprints-0.2.4 spec/active_record/blueprints.rb
blueprints-0.2.3 spec/blueprints.rb
blueprints-0.2.2 spec/blueprints.rb
blueprints-0.2.1 spec/blueprints.rb