seeding 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.md +27 -1
  2. data/lib/seeding/version.rb +1 -1
  3. metadata +1 -1
data/README.md CHANGED
@@ -37,8 +37,34 @@ Example:
37
37
  `1.9.3p0 :001 > Seeding::CreateSeed.new.query { Category.all(:order => "name desc", :select => "id, name, country, catgroup") }`
38
38
 
39
39
  creates:
40
+ seeding-Category-604a68a0-c3f4-012f-fcf7-482a14164364.rb
41
+
42
+ Which looks basically like this:
43
+
44
+ Category.create! :id => 324, :name => 'Zoohandlungen ', :country => 'de', :catgroup => 'Einkaufen'
45
+ puts "."
46
+ Category.create! :id => 288, :name => 'Zeitungen und Zeitschriften', :country => 'de', :catgroup => 'Werbung & Medien'
47
+ puts "."
48
+ Category.create! :id => 76, :name => 'Zeitarbeit', :country => 'de', :catgroup => 'Bildung & Beruf'
49
+ puts "."
50
+ Category.create! :id => 107, :name => 'Zahnmedizin', :country => 'de', :catgroup => 'Gesundheit'
51
+ puts "."
52
+ Category.create! :id => 229, :name => 'Yoga ', :country => 'de', :catgroup => 'Beauty & Wellness'
53
+ puts "."
54
+ Category.create! :id => 52, :name => 'Wohnungs- und Zimmervermittlung ', :country => 'de', :catgroup => 'Öffentliches & Soziales'
55
+
56
+ ... and so on....
57
+
58
+ The puts "." is pretty lame I admit but it's just nice to see that there are still rows written which is indicated by all these dots. If anything, this is better than writing seeds files by hand:-)
59
+
60
+ If you need a lot of data in your seed files from different models,: I recommend to combine them via `cat` or good old copy and paste. Of course you could also iterate over a directory with multiple seed files.
61
+
62
+ Once you are satisfied with your seed files just copy them to db/seeds.rb
63
+ and run:
64
+ `rake db:seed`
65
+
66
+ done!
40
67
 
41
-
42
68
 
43
69
 
44
70
 
@@ -1,3 +1,3 @@
1
1
  module Seeding
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seeding
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: