Note that there are some explanatory texts on larger screens.

plurals
  1. POSeeds database every time I run rails server
    primarykey
    data
    text
    <p>I know to seed the database, I run rake db:seed and everything. I have my seeds.rb file all set up:</p> <pre><code>users = [{:name =&gt; 'User1 Lastname', :email =&gt; 'user1@example.com', :password =&gt; 'password'}, {:name =&gt; 'User2', :email =&gt; 'user2@example.com', :password =&gt; 'password'}, {:name =&gt; 'User3', :email =&gt; 'user3@example.com', :password =&gt; 'password'}, {:name =&gt; 'User4', :email =&gt; 'user4@example.com', :password =&gt; 'password'}, {:name =&gt; 'User5', :email =&gt; 'user5@example.com', :password =&gt; 'password'}, {:name =&gt; 'User6', :email =&gt; 'user6@example.com', :password =&gt; 'password'}, {:name =&gt; 'User7', :email =&gt; 'user7@example.com', :password =&gt; 'password'}, {:name =&gt; 'User8', :email =&gt; 'user8@example.com', :password =&gt; 'password'}, {:name =&gt; 'User9', :email =&gt; 'user9@example.com', :password =&gt; 'password'}, {:name =&gt; 'User10', :email =&gt; 'user10@example.com', :password =&gt; 'password'}, {:name =&gt; 'User11', :email =&gt; 'user11@example.com', :password =&gt; 'password'}, {:name =&gt; 'User12', :email =&gt; 'user12@example.com', :password =&gt; 'password'}, {:name =&gt; 'User13', :email =&gt; 'user13@example.com', :password =&gt; 'password'}, {:name =&gt; 'User14', :email =&gt; 'user14@example.com', :password =&gt; 'password'}, {:name =&gt; 'User15', :email =&gt; 'user15@example.com', :password =&gt; 'password'}, {:name =&gt; 'User16', :email =&gt; 'user16@example.com', :password =&gt; 'password'}, {:name =&gt; 'User17', :email =&gt; 'user17@example.com', :password =&gt; 'password'}, {:name =&gt; 'User18', :email =&gt; 'user18@example.com', :password =&gt; 'password'}, {:name =&gt; 'User19', :email =&gt; 'user19@example.com', :password =&gt; 'password'}, {:name =&gt; 'User20', :email =&gt; 'user20@example.com', :password =&gt; 'password'}, ] users.each do |user| User.create(user) end </code></pre> <p>But now whenever I run <code>rails server</code> it seeds them all again! I thought that was only supposed to happen when I run <code>rake db:seed</code></p> <pre><code>~$ rails server =&gt; Booting WEBrick =&gt; Rails 3.2.14 application starting in development on http://0.0.0.0:3000 =&gt; Call with -d to detach =&gt; Ctrl-C to shutdown server Connecting to database specified by database.yml (0.1ms) begin transaction User Exists (21.5ms) SELECT 1 AS one FROM "users" WHERE LOWER("users"."email") = LOWER('user1@example.com') LIMIT 1 (0.1ms) rollback transaction (0.1ms) begin transaction User Exists (1.4ms) SELECT 1 AS one FROM "users" WHERE LOWER("users"."email") = LOWER('user2@example.com') LIMIT 1 (0.1ms) rollback transaction (0.1ms) begin transaction User Exists (1.3ms) SELECT 1 AS one FROM "users" WHERE LOWER("users"."email") = LOWER('user3@example.com') LIMIT 1 (0.1ms) rollback transaction </code></pre> <p>etc etc for 20 users then launches it:</p> <pre><code>[2013-11-07 00:59:14] INFO WEBrick 1.3.1 [2013-11-07 00:59:14] INFO ruby 1.9.3 (2013-06-27) [i686-linux] [2013-11-07 00:59:14] INFO WEBrick::HTTPServer#start: pid=1742 port=3000 </code></pre> <p>Any help would be greatly appreciated!! Thank you </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload