seeding 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +1 -1
- data/lib/seeding/create_seed.rb +3 -2
- data/lib/seeding/version.rb +1 -1
- data/seeding.gemspec +1 -1
- metadata +5 -9
data/README.md
CHANGED
@@ -29,7 +29,7 @@ Examples:
|
|
29
29
|
`Seeding::CreateSeed.new.query { MyModel.where("id < 10000") }`
|
30
30
|
`Seeding::CreateSeed.new.query { User.where(test: true)}`
|
31
31
|
`Seeding::CreateSeed.new.query { Category.all(:order => "name desc") }`
|
32
|
-
`Seeding::CreateSeed.new.query { Category.all(:order => "name desc", :select => "id, name, country
|
32
|
+
`Seeding::CreateSeed.new.query { Category.all(:order => "name desc", :select => "id, name, country") }`
|
33
33
|
|
34
34
|
It then creates a file in the root directory in your application named seeding-MyModel + guid sequence to prevent accidentally overwriting
|
35
35
|
|
data/lib/seeding/create_seed.rb
CHANGED
@@ -22,14 +22,15 @@ module Seeding
|
|
22
22
|
if v[at].class.to_s == "Fixnum"
|
23
23
|
str << " :#{at} => #{v[at]}, "
|
24
24
|
else
|
25
|
-
str << " :#{at} =>
|
25
|
+
str << " :#{at} => \"#{v[at]}\", "
|
26
26
|
end
|
27
27
|
end
|
28
|
+
# todo: Clean this up
|
28
29
|
str << "**"
|
29
30
|
str.gsub!(", **", "")
|
30
31
|
str << "\n"
|
31
32
|
file.puts str
|
32
|
-
file.puts "
|
33
|
+
file.puts "print \".\""
|
33
34
|
end
|
34
35
|
end
|
35
36
|
end
|
data/lib/seeding/version.rb
CHANGED
data/seeding.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |gem|
|
|
10
10
|
|
11
11
|
gem.files = `git ls-files`.split($\)
|
12
12
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
13
|
-
|
13
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
14
|
gem.name = "seeding"
|
15
15
|
gem.require_paths = ["lib"]
|
16
16
|
gem.version = Seeding::VERSION
|
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.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-08-09 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: uuid
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirement: &70287250827500 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,12 +21,7 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ! '>='
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '0'
|
24
|
+
version_requirements: *70287250827500
|
30
25
|
description: Seeding creates a seed.rb from your existing database. You can write
|
31
26
|
queries on the rails console and it will write the results to your seed.rb. I wrote
|
32
27
|
it after having to create seed files with thousands of rows and could not handle
|
@@ -66,8 +61,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
66
61
|
version: '0'
|
67
62
|
requirements: []
|
68
63
|
rubyforge_project:
|
69
|
-
rubygems_version: 1.8.
|
64
|
+
rubygems_version: 1.8.10
|
70
65
|
signing_key:
|
71
66
|
specification_version: 3
|
72
67
|
summary: Seeding creates a seed.rb from query results
|
73
68
|
test_files: []
|
69
|
+
has_rdoc:
|