Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

update readme for ordering setup and building steps #31

Merged
merged 1 commit into from

2 participants

@Gibheer

The setup has to be done before the build, as it is building the engine
instances which are required for the mappers.

@Gibheer Gibheer move setup step before build
The setup has to be done before the build, as it is building the engine
instances which are required for the mappers.
16fe13a
@solnic solnic merged commit 2d7ae19 into solnic:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 22, 2013
  1. @Gibheer

    move setup step before build

    Gibheer authored
    The setup has to be done before the build, as it is building the engine
    instances which are required for the mappers.
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 9 deletions.
  1. +9 −9 README.md
View
18 README.md
@@ -81,6 +81,9 @@ end
# Create DM env
env = DataMapper::Environment.new
+# Setup db connection
+env.setup(:postgres, :uri => 'postgres://localhost/test')
+
# Define a mapper
env.build(User, :postgres) do
relation_name :users
@@ -89,9 +92,6 @@ env.build(User, :postgres) do
map :name, String, :to => :username
end
-# Setup db connection
-env.setup(:postgres, :uri => 'postgres://localhost/test')
-
# Finalize the environment
env.finalize
```
@@ -120,6 +120,9 @@ end
# Create DM env
env = DataMapper::Environment.new
+# Setup db connection
+env.setup(:postgres, :uri => 'postgres://localhost/test')
+
env.build(Order, :postgres) do
relation_name :orders
@@ -142,9 +145,6 @@ env.build(User, :postgres) do
end
end
-# Setup db connection
-env.setup(:postgres, :uri => 'postgres://localhost/test')
-
# Finalize the environment
env.finalize
@@ -181,6 +181,9 @@ end
# Create DM env
env = DataMapper::Environment.new
+# Setup db connection
+env.setup(:postgres, :uri => 'postgres://localhost/test')
+
env.build(Order, :postgres) do
key :id
end
@@ -193,9 +196,6 @@ env.build(User, :postgres) do
has 0..n, :orders, Order
end
-# Setup db connection
-env.setup(:postgres, :uri => 'postgres://localhost/test')
-
# Finalize the environment
env.finalize
Something went wrong with that request. Please try again.