migrant 0.1.2 → 0.1.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/Rakefile +2 -3
- data/VERSION +1 -1
- data/lib/datatype/base.rb +1 -0
- data/lib/datatype/fixnum.rb +7 -0
- data/lib/migrant/model_extensions.rb +2 -2
- data/migrant.gemspec +9 -13
- data/test/additional_models/review.rb +1 -0
- data/test/verified_output/migrations/create_reviews.rb +1 -0
- metadata +6 -22
- data/test/rails_app/db/schema.rb +0 -82
data/Rakefile
CHANGED
@@ -14,9 +14,8 @@ begin
|
|
14
14
|
gem.add_development_dependency "ansi", "= 1.2.2"
|
15
15
|
gem.add_development_dependency "turn", "= 0.8.1"
|
16
16
|
gem.add_development_dependency "sqlite3-ruby", ">= 0"
|
17
|
-
gem.add_development_dependency "simplecov", "
|
18
|
-
gem.add_dependency "
|
19
|
-
gem.add_dependency "activesupport", ">= 3.0.0"
|
17
|
+
gem.add_development_dependency "simplecov", "= 0.3.5"
|
18
|
+
gem.add_dependency "rails", ">= 3.0.0"
|
20
19
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
21
20
|
end
|
22
21
|
Jeweler::GemcutterTasks.new
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.3
|
data/lib/datatype/base.rb
CHANGED
@@ -21,13 +21,13 @@ module Migrant
|
|
21
21
|
structure {}
|
22
22
|
end
|
23
23
|
|
24
|
-
def mock(recursive=true)
|
24
|
+
def mock(attributes={}, recursive=true)
|
25
25
|
attribs = @schema.columns.reject { |column| column.is_a?(DataType::ForeignKey)}.collect { |name, data_type| [name, data_type.mock] }.flatten
|
26
26
|
# Only recurse to one level, otherwise things get way too complicated
|
27
27
|
if recursive
|
28
28
|
attribs += self.reflect_on_all_associations(:belongs_to).collect do |association|
|
29
29
|
begin
|
30
|
-
(association.klass.respond_to?(:mock))? [association.name, association.klass.mock(false)] : nil
|
30
|
+
(association.klass.respond_to?(:mock))? [association.name, association.klass.mock({}, false)] : nil
|
31
31
|
rescue NameError; nil; end # User hasn't defined association, just skip it
|
32
32
|
end.compact.flatten
|
33
33
|
end
|
data/migrant.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{migrant}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Pascal Houliston"]
|
12
|
-
s.date = %q{2010-11-
|
12
|
+
s.date = %q{2010-11-23}
|
13
13
|
s.description = %q{Migrant gives you a super-clean DSL to describe your ActiveRecord models (somewhat similar to DataMapper) and generates all your migrations for you so you can spend more time coding the stuff that counts!}
|
14
14
|
s.email = %q{101pascal@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -25,6 +25,7 @@ Gem::Specification.new do |s|
|
|
25
25
|
"lib/datatype/boolean.rb",
|
26
26
|
"lib/datatype/currency.rb",
|
27
27
|
"lib/datatype/date.rb",
|
28
|
+
"lib/datatype/fixnum.rb",
|
28
29
|
"lib/datatype/float.rb",
|
29
30
|
"lib/datatype/foreign_key.rb",
|
30
31
|
"lib/datatype/hash.rb",
|
@@ -69,7 +70,6 @@ Gem::Specification.new do |s|
|
|
69
70
|
"test/rails_app/config/initializers/session_store.rb",
|
70
71
|
"test/rails_app/config/locales/en.yml",
|
71
72
|
"test/rails_app/config/routes.rb",
|
72
|
-
"test/rails_app/db/schema.rb",
|
73
73
|
"test/rails_app/db/seeds.rb",
|
74
74
|
"test/rails_app/lib/tasks/.gitkeep",
|
75
75
|
"test/rails_app/public/404.html",
|
@@ -116,7 +116,6 @@ Gem::Specification.new do |s|
|
|
116
116
|
"test/rails_app/config/initializers/secret_token.rb",
|
117
117
|
"test/rails_app/config/initializers/session_store.rb",
|
118
118
|
"test/rails_app/config/routes.rb",
|
119
|
-
"test/rails_app/db/schema.rb",
|
120
119
|
"test/rails_app/db/seeds.rb",
|
121
120
|
"test/rails_app/test/performance/browsing_test.rb",
|
122
121
|
"test/rails_app/test/test_helper.rb",
|
@@ -141,26 +140,23 @@ Gem::Specification.new do |s|
|
|
141
140
|
s.add_development_dependency(%q<ansi>, ["= 1.2.2"])
|
142
141
|
s.add_development_dependency(%q<turn>, ["= 0.8.1"])
|
143
142
|
s.add_development_dependency(%q<sqlite3-ruby>, [">= 0"])
|
144
|
-
s.add_development_dependency(%q<simplecov>, ["
|
145
|
-
s.add_runtime_dependency(%q<
|
146
|
-
s.add_runtime_dependency(%q<activesupport>, [">= 3.0.0"])
|
143
|
+
s.add_development_dependency(%q<simplecov>, ["= 0.3.5"])
|
144
|
+
s.add_runtime_dependency(%q<rails>, [">= 3.0.0"])
|
147
145
|
else
|
148
146
|
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
149
147
|
s.add_dependency(%q<ansi>, ["= 1.2.2"])
|
150
148
|
s.add_dependency(%q<turn>, ["= 0.8.1"])
|
151
149
|
s.add_dependency(%q<sqlite3-ruby>, [">= 0"])
|
152
|
-
s.add_dependency(%q<simplecov>, ["
|
153
|
-
s.add_dependency(%q<
|
154
|
-
s.add_dependency(%q<activesupport>, [">= 3.0.0"])
|
150
|
+
s.add_dependency(%q<simplecov>, ["= 0.3.5"])
|
151
|
+
s.add_dependency(%q<rails>, [">= 3.0.0"])
|
155
152
|
end
|
156
153
|
else
|
157
154
|
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
158
155
|
s.add_dependency(%q<ansi>, ["= 1.2.2"])
|
159
156
|
s.add_dependency(%q<turn>, ["= 0.8.1"])
|
160
157
|
s.add_dependency(%q<sqlite3-ruby>, [">= 0"])
|
161
|
-
s.add_dependency(%q<simplecov>, ["
|
162
|
-
s.add_dependency(%q<
|
163
|
-
s.add_dependency(%q<activesupport>, [">= 3.0.0"])
|
158
|
+
s.add_dependency(%q<simplecov>, ["= 0.3.5"])
|
159
|
+
s.add_dependency(%q<rails>, [">= 3.0.0"])
|
164
160
|
end
|
165
161
|
end
|
166
162
|
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 3
|
9
|
+
version: 0.1.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Pascal Houliston
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-11-
|
17
|
+
date: 2010-11-23 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -79,7 +79,7 @@ dependencies:
|
|
79
79
|
requirement: &id005 !ruby/object:Gem::Requirement
|
80
80
|
none: false
|
81
81
|
requirements:
|
82
|
-
- - "
|
82
|
+
- - "="
|
83
83
|
- !ruby/object:Gem::Version
|
84
84
|
segments:
|
85
85
|
- 0
|
@@ -89,7 +89,7 @@ dependencies:
|
|
89
89
|
type: :development
|
90
90
|
version_requirements: *id005
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
|
-
name:
|
92
|
+
name: rails
|
93
93
|
prerelease: false
|
94
94
|
requirement: &id006 !ruby/object:Gem::Requirement
|
95
95
|
none: false
|
@@ -103,21 +103,6 @@ dependencies:
|
|
103
103
|
version: 3.0.0
|
104
104
|
type: :runtime
|
105
105
|
version_requirements: *id006
|
106
|
-
- !ruby/object:Gem::Dependency
|
107
|
-
name: activesupport
|
108
|
-
prerelease: false
|
109
|
-
requirement: &id007 !ruby/object:Gem::Requirement
|
110
|
-
none: false
|
111
|
-
requirements:
|
112
|
-
- - ">="
|
113
|
-
- !ruby/object:Gem::Version
|
114
|
-
segments:
|
115
|
-
- 3
|
116
|
-
- 0
|
117
|
-
- 0
|
118
|
-
version: 3.0.0
|
119
|
-
type: :runtime
|
120
|
-
version_requirements: *id007
|
121
106
|
description: Migrant gives you a super-clean DSL to describe your ActiveRecord models (somewhat similar to DataMapper) and generates all your migrations for you so you can spend more time coding the stuff that counts!
|
122
107
|
email: 101pascal@gmail.com
|
123
108
|
executables: []
|
@@ -136,6 +121,7 @@ files:
|
|
136
121
|
- lib/datatype/boolean.rb
|
137
122
|
- lib/datatype/currency.rb
|
138
123
|
- lib/datatype/date.rb
|
124
|
+
- lib/datatype/fixnum.rb
|
139
125
|
- lib/datatype/float.rb
|
140
126
|
- lib/datatype/foreign_key.rb
|
141
127
|
- lib/datatype/hash.rb
|
@@ -180,7 +166,6 @@ files:
|
|
180
166
|
- test/rails_app/config/initializers/session_store.rb
|
181
167
|
- test/rails_app/config/locales/en.yml
|
182
168
|
- test/rails_app/config/routes.rb
|
183
|
-
- test/rails_app/db/schema.rb
|
184
169
|
- test/rails_app/db/seeds.rb
|
185
170
|
- test/rails_app/lib/tasks/.gitkeep
|
186
171
|
- test/rails_app/public/404.html
|
@@ -254,7 +239,6 @@ test_files:
|
|
254
239
|
- test/rails_app/config/initializers/secret_token.rb
|
255
240
|
- test/rails_app/config/initializers/session_store.rb
|
256
241
|
- test/rails_app/config/routes.rb
|
257
|
-
- test/rails_app/db/schema.rb
|
258
242
|
- test/rails_app/db/seeds.rb
|
259
243
|
- test/rails_app/test/performance/browsing_test.rb
|
260
244
|
- test/rails_app/test/test_helper.rb
|
data/test/rails_app/db/schema.rb
DELETED
@@ -1,82 +0,0 @@
|
|
1
|
-
# This file is auto-generated from the current state of the database. Instead
|
2
|
-
# of editing this file, please use the migrations feature of Active Record to
|
3
|
-
# incrementally modify your database, and then regenerate this schema definition.
|
4
|
-
#
|
5
|
-
# Note that this schema.rb definition is the authoritative source for your
|
6
|
-
# database schema. If you need to create the application database on another
|
7
|
-
# system, you should be using db:schema:load, not running all the migrations
|
8
|
-
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
9
|
-
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
10
|
-
#
|
11
|
-
# It's strongly recommended to check this file into your version control system.
|
12
|
-
|
13
|
-
ActiveRecord::Schema.define(:version => 20101122122964) do
|
14
|
-
|
15
|
-
create_table "business_categories", :force => true do |t|
|
16
|
-
t.integer "business_id"
|
17
|
-
t.integer "category_id"
|
18
|
-
t.decimal "test_currency_mockup", :precision => 10, :scale => 2
|
19
|
-
t.datetime "test_date_mockup"
|
20
|
-
t.float "test_float_mockup"
|
21
|
-
t.integer "test_range_mockup"
|
22
|
-
end
|
23
|
-
|
24
|
-
add_index "business_categories", ["business_id"], :name => "index_business_categories_on_business_id"
|
25
|
-
add_index "business_categories", ["category_id"], :name => "index_business_categories_on_category_id"
|
26
|
-
|
27
|
-
create_table "businesses", :force => true do |t|
|
28
|
-
t.integer "user_id"
|
29
|
-
t.string "owner_type"
|
30
|
-
t.integer "owner_id"
|
31
|
-
t.string "name"
|
32
|
-
t.string "website"
|
33
|
-
t.text "address"
|
34
|
-
t.string "summary"
|
35
|
-
t.text "description"
|
36
|
-
t.text "landline", :limit => 255
|
37
|
-
t.string "mobile"
|
38
|
-
t.integer "operating_days", :limit => 1
|
39
|
-
t.datetime "date_established"
|
40
|
-
t.datetime "next_sale"
|
41
|
-
t.boolean "verified"
|
42
|
-
t.string "location", :limit => 127
|
43
|
-
t.float "estimated_value"
|
44
|
-
t.string "notes"
|
45
|
-
end
|
46
|
-
|
47
|
-
add_index "businesses", ["owner_id"], :name => "index_businesses_on_owner_id"
|
48
|
-
add_index "businesses", ["owner_type", "owner_id"], :name => "index_businesses_on_owner_type_and_owner_id"
|
49
|
-
add_index "businesses", ["user_id"], :name => "index_businesses_on_user_id"
|
50
|
-
|
51
|
-
create_table "categories", :force => true do |t|
|
52
|
-
t.string "title"
|
53
|
-
t.string "summary"
|
54
|
-
end
|
55
|
-
|
56
|
-
add_index "categories", ["title"], :name => "index_categories_on_title"
|
57
|
-
|
58
|
-
create_table "reviews", :force => true do |t|
|
59
|
-
t.integer "business_id"
|
60
|
-
t.integer "user_id"
|
61
|
-
t.string "name"
|
62
|
-
t.integer "rating", :limit => 1
|
63
|
-
t.text "body"
|
64
|
-
end
|
65
|
-
|
66
|
-
add_index "reviews", ["business_id"], :name => "index_reviews_on_business_id"
|
67
|
-
add_index "reviews", ["user_id"], :name => "index_reviews_on_user_id"
|
68
|
-
|
69
|
-
create_table "users", :force => true do |t|
|
70
|
-
t.string "name"
|
71
|
-
t.string "email"
|
72
|
-
t.string "encrypted_password", :limit => 48
|
73
|
-
t.string "password_salt", :limit => 42
|
74
|
-
t.decimal "money_spent", :precision => 10, :scale => 2
|
75
|
-
t.decimal "money_gifted", :precision => 10, :scale => 2
|
76
|
-
t.float "average_rating"
|
77
|
-
t.integer "business_id"
|
78
|
-
end
|
79
|
-
|
80
|
-
add_index "users", ["business_id"], :name => "index_users_on_business_id"
|
81
|
-
|
82
|
-
end
|