legacy_data 0.1.12 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. data/.rvmrc +1 -0
  2. data/History.txt +2 -2
  3. data/README.md +6 -4
  4. data/Rakefile +9 -11
  5. data/VERSION +1 -1
  6. data/examples/generated/blog_mysql/factories.rb +3 -3
  7. data/examples/generated/blog_sqlite3/factories.rb +4 -4
  8. data/examples/generated/drupal_mysql/factories.rb +321 -321
  9. data/examples/generated/j2ee_petstore_mysql/factories.rb +39 -39
  10. data/examples/generated/j2ee_petstore_oracle/factories.rb +36 -36
  11. data/examples/generated/j2ee_petstore_sqlite3/factories.rb +39 -39
  12. data/legacy_data.gemspec +4 -3
  13. data/lib/{active_record/connection_adapters/oracleenhanced_adapter.rb → foreigner/connection_adapters/oracle_enhanced_adapter.rb} +0 -0
  14. data/lib/generators/models_from_tables/USAGE +12 -0
  15. data/lib/generators/models_from_tables/models_from_tables_generator.rb +70 -0
  16. data/lib/generators/models_from_tables/templates/model.rb +11 -0
  17. data/lib/legacy_data.rb +6 -7
  18. data/lib/legacy_data/schema.rb +1 -0
  19. data/lib/legacy_data/table_class_name_mapper.rb +4 -2
  20. data/lib/legacy_data/table_definition.rb +1 -2
  21. data/spec/functional/blog_adapterspec.rb +13 -13
  22. data/spec/functional/drupal_adapterspec.rb +14 -12
  23. data/spec/functional/functional_spec_helper.rb +3 -5
  24. data/spec/functional/j2ee_petstore_adapterspec.rb +14 -14
  25. data/spec/generators/models_from_tables/expected/factories.rb +5 -0
  26. data/spec/{expected → generators/models_from_tables/expected}/post.rb +0 -0
  27. data/spec/{models_from_tables_generator_spec.rb → generators/models_from_tables/models_from_tables_generator_spec.rb} +28 -28
  28. data/spec/legacy_data/schema_spec.rb +0 -1
  29. data/spec/legacy_data/table_class_name_mapper_spec.rb +1 -4
  30. data/spec/spec_helper.rb +46 -28
  31. metadata +66 -49
  32. data/generators/models_from_tables/USAGE +0 -6
  33. data/generators/models_from_tables/models_from_tables_generator.rb +0 -78
  34. data/generators/models_from_tables/templates/model.rb +0 -11
  35. data/spec/expected/factories.rb +0 -5
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm @legacy_data
@@ -1,5 +1,5 @@
1
- === EDGE
2
- * Working on support for Rails 3
1
+ === 0.2.0 2010-12-02
2
+ * First version to work with Rails 3
3
3
 
4
4
  === 0.1.12 2010-11-18
5
5
  * The last Rails 2.3 release
data/README.md CHANGED
@@ -5,6 +5,8 @@ encoded in the database? Do you have to understand the entire data model before
5
5
  in the `legacy_data` gem can help! This generator looks into your existing database and generates ActiveRecord models based on the
6
6
  information encoded in it.
7
7
 
8
+ * If you are using Rails 2.3 you must use v 0.1.12 of this gem "gem install legacy_data --version 0.1.12"
9
+
8
10
 
9
11
  ## How to use it
10
12
 
@@ -14,17 +16,17 @@ information encoded in it.
14
16
 
15
17
  - If you don't want all tables in the database tell it which table to model
16
18
 
17
- `script/generate models_from_tables --table-name comments`
19
+ `script/generate models_from_tables comments`
18
20
 
19
21
  This uses any foreign_key constraints in the database to spider the database and model the comments table and all associated tables.
20
22
 
21
23
  - If you *really* only want the comments table tell it not to follow any foreign_keys
22
24
 
23
- `script/generate models_from_tables --table-name comments --skip-associated`
25
+ `script/generate models_from_tables comments --skip-associated`
24
26
 
25
27
  - If you use [factory girl](http://github.com/thoughtbot/factory_girl) it will generate a simple factory for each model it generates
26
28
 
27
- `script/generate models_from_tables --table-name comments --with-factories`
29
+ `script/generate models_from_tables comments`
28
30
 
29
31
  (You do need to install the plugin `gem install legacy_data` as long as http://gemcutter.org is one of your gem sources)
30
32
 
@@ -85,4 +87,4 @@ end
85
87
 
86
88
  # Copyright
87
89
 
88
- Copyright (c) 2009 Alex Rothenberg. See LICENSE for details.
90
+ Copyright (c) 2010 Alex Rothenberg. See LICENSE for details.
data/Rakefile CHANGED
@@ -13,7 +13,6 @@ end
13
13
  require 'rake'
14
14
 
15
15
  task :default => :spec_all
16
- task :spec => :check_dependencies
17
16
 
18
17
 
19
18
  # GEM Tasks --------------------------------------------------------
@@ -23,10 +22,9 @@ Rake::GemPackageTask.new(spec) do |pkg|
23
22
  end
24
23
  # --------------------------------------------------------
25
24
 
26
- require 'spec/rake/spectask'
27
- Spec::Rake::SpecTask.new(:spec) do |spec|
28
- spec.libs << 'lib' << 'spec'
29
- spec.spec_files = FileList['spec/**/*_spec.rb']
25
+ require "rspec/core/rake_task"
26
+ # rake spec
27
+ RSpec::Core::RakeTask.new :spec do |spec|
30
28
  end
31
29
 
32
30
  def print_msg msg
@@ -60,11 +58,13 @@ def adapters
60
58
  %w( mysql sqlite3 oracle)
61
59
  end
62
60
 
61
+ # run specs for one database adapter
62
+ # i.e. rake mysql:spec OR rake sqlite3:spec
63
63
  for adapter in adapters
64
64
  namespace adapter do
65
- Spec::Rake::SpecTask.new(:spec) do |spec|
66
- spec.libs << 'lib' << 'spec'
67
- spec.spec_files = FileList["spec/**/*_adapterspec.rb"]
65
+ desc "Run functional specs using database adapter #{adapter}"
66
+ RSpec::Core::RakeTask.new :spec do |spec|
67
+ spec.pattern = "spec/**/*_adapterspec.rb"
68
68
  end
69
69
  end
70
70
  end
@@ -74,9 +74,7 @@ task :spec_all => :spec do
74
74
  run_functional_without_aborting(*adapters)
75
75
  end
76
76
 
77
- Spec::Rake::SpecTask.new(:rcov) do |spec|
78
- spec.libs << 'lib' << 'spec'
79
- spec.pattern = 'spec/**/*_spec.rb'
77
+ RSpec::Core::RakeTask.new :rcov do |spec|
80
78
  spec.rcov = true
81
79
  spec.rcov_opts = ['--exclude spec,gems', '--sort coverage']
82
80
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.12
1
+ 0.2.0
@@ -1,9 +1,9 @@
1
- Factory.define :comment do |c|
1
+ Factory.define :comment do |comment|
2
2
  end
3
3
 
4
- Factory.define :post do |p|
4
+ Factory.define :post do |post|
5
5
  end
6
6
 
7
- Factory.define :tag do |t|
7
+ Factory.define :tag do |tag|
8
8
  end
9
9
 
@@ -1,12 +1,12 @@
1
- Factory.define :comment do |c|
1
+ Factory.define :comment do |comment|
2
2
  end
3
3
 
4
- Factory.define :post_tag do |p|
4
+ Factory.define :post_tag do |post_tag|
5
5
  end
6
6
 
7
- Factory.define :post do |p|
7
+ Factory.define :post do |post|
8
8
  end
9
9
 
10
- Factory.define :tag do |t|
10
+ Factory.define :tag do |tag|
11
11
  end
12
12
 
@@ -1,370 +1,370 @@
1
- Factory.define :access do |a|
2
- a.mask 'some string'
3
- a.type 'some string'
4
- a.status 7
1
+ Factory.define :access do |access|
2
+ access.mask 'some string'
3
+ access.type 'some string'
4
+ access.status 7
5
5
  end
6
6
 
7
- Factory.define :action do |a|
8
- a.type 'some string'
9
- a.callback 'some string'
10
- a.parameters 'some text value'
11
- a.description 'some string'
7
+ Factory.define :action do |action|
8
+ action.type 'some string'
9
+ action.callback 'some string'
10
+ action.parameters 'some text value'
11
+ action.description 'some string'
12
12
  end
13
13
 
14
- Factory.define :actions_aid do |a|
14
+ Factory.define :actions_aid do |actions_aid|
15
15
  end
16
16
 
17
- Factory.define :authmap do |a|
18
- a.uid 7
19
- a.authname 'some string'
20
- a.module 'some string'
17
+ Factory.define :authmap do |authmap|
18
+ authmap.uid 7
19
+ authmap.authname 'some string'
20
+ authmap.module 'some string'
21
21
  end
22
22
 
23
- Factory.define :batch do |b|
24
- b.token 'some string'
25
- b.timestamp 7
23
+ Factory.define :batch do |batch|
24
+ batch.token 'some string'
25
+ batch.timestamp 7
26
26
  end
27
27
 
28
- Factory.define :block do |b|
29
- b.module 'some string'
30
- b.delta 'some string'
31
- b.theme 'some string'
32
- b.status 7
33
- b.weight 7
34
- b.region 'some string'
35
- b.custom 7
36
- b.throttle 7
37
- b.visibility 7
38
- b.pages 'some text value'
39
- b.title 'some string'
40
- b.cache 7
28
+ Factory.define :block do |block|
29
+ block.module 'some string'
30
+ block.delta 'some string'
31
+ block.theme 'some string'
32
+ block.status 7
33
+ block.weight 7
34
+ block.region 'some string'
35
+ block.custom 7
36
+ block.throttle 7
37
+ block.visibility 7
38
+ block.pages 'some text value'
39
+ block.title 'some string'
40
+ block.cache 7
41
41
  end
42
42
 
43
- Factory.define :blocks_role do |b|
44
- b.module 'some string'
45
- b.delta 'some string'
46
- b.rid 7
43
+ Factory.define :blocks_role do |blocks_role|
44
+ blocks_role.module 'some string'
45
+ blocks_role.delta 'some string'
46
+ blocks_role.rid 7
47
47
  end
48
48
 
49
- Factory.define :box do |b|
50
- b.info 'some string'
51
- b.format 7
49
+ Factory.define :box do |box|
50
+ box.info 'some string'
51
+ box.format 7
52
52
  end
53
53
 
54
- Factory.define :cache do |c|
55
- c.expire 7
56
- c.created 7
57
- c.serialized 7
54
+ Factory.define :cache do |cache|
55
+ cache.expire 7
56
+ cache.created 7
57
+ cache.serialized 7
58
58
  end
59
59
 
60
- Factory.define :cache_block do |c|
61
- c.expire 7
62
- c.created 7
63
- c.serialized 7
60
+ Factory.define :cache_block do |cache_block|
61
+ cache_block.expire 7
62
+ cache_block.created 7
63
+ cache_block.serialized 7
64
64
  end
65
65
 
66
- Factory.define :cache_filter do |c|
67
- c.expire 7
68
- c.created 7
69
- c.serialized 7
66
+ Factory.define :cache_filter do |cache_filter|
67
+ cache_filter.expire 7
68
+ cache_filter.created 7
69
+ cache_filter.serialized 7
70
70
  end
71
71
 
72
- Factory.define :cache_form do |c|
73
- c.expire 7
74
- c.created 7
75
- c.serialized 7
72
+ Factory.define :cache_form do |cache_form|
73
+ cache_form.expire 7
74
+ cache_form.created 7
75
+ cache_form.serialized 7
76
76
  end
77
77
 
78
- Factory.define :cache_menu do |c|
79
- c.expire 7
80
- c.created 7
81
- c.serialized 7
78
+ Factory.define :cache_menu do |cache_menu|
79
+ cache_menu.expire 7
80
+ cache_menu.created 7
81
+ cache_menu.serialized 7
82
82
  end
83
83
 
84
- Factory.define :cache_page do |c|
85
- c.expire 7
86
- c.created 7
87
- c.serialized 7
88
- end
89
-
90
- Factory.define :cache_update do |c|
91
- c.expire 7
92
- c.created 7
93
- c.serialized 7
84
+ Factory.define :cache_page do |cache_page|
85
+ cache_page.expire 7
86
+ cache_page.created 7
87
+ cache_page.serialized 7
88
+ end
89
+
90
+ Factory.define :cache_update do |cache_update|
91
+ cache_update.expire 7
92
+ cache_update.created 7
93
+ cache_update.serialized 7
94
94
  end
95
95
 
96
- Factory.define :comment do |c|
97
- c.pid 7
98
- c.nid 7
99
- c.uid 7
100
- c.subject 'some string'
101
- c.comment 'some text value'
102
- c.hostname 'some string'
103
- c.timestamp 7
104
- c.status 7
105
- c.format 7
106
- c.thread 'some string'
107
- end
108
-
109
- Factory.define :uploaded_files do |u|
110
- u.uid 7
111
- u.filename 'some string'
112
- u.filepath 'some string'
113
- u.filemime 'some string'
114
- u.filesize 7
115
- u.status 7
116
- u.timestamp 7
117
- end
118
-
119
- Factory.define :filter_format do |f|
120
- f.name 'some string'
121
- f.roles 'some string'
122
- f.cache 7
123
- end
124
-
125
- Factory.define :filter do |f|
126
- f.format 7
127
- f.module 'some string'
128
- f.delta 7
129
- f.weight 7
130
- end
131
-
132
- Factory.define :flood do |f|
133
- f.event 'some string'
134
- f.hostname 'some string'
135
- f.timestamp 7
136
- end
137
-
138
- Factory.define :history do |h|
139
- h.uid 7
140
- h.nid 7
141
- h.timestamp 7
142
- end
143
-
144
- Factory.define :menu_custom do |m|
145
- m.title 'some string'
146
- end
147
-
148
- Factory.define :menu_link do |m|
149
- m.menu_name 'some string'
150
- m.plid 7
151
- m.link_path 'some string'
152
- m.router_path 'some string'
153
- m.link_title 'some string'
154
- m.module 'some string'
155
- m.hidden 7
156
- m.external 7
157
- m.has_children 7
158
- m.expanded 7
159
- m.weight 7
160
- m.depth 7
161
- m.customized 7
162
- m.p1 7
163
- m.p2 7
164
- m.p3 7
165
- m.p4 7
166
- m.p5 7
167
- m.p6 7
168
- m.p7 7
169
- m.p8 7
170
- m.p9 7
171
- m.updated 7
172
- end
173
-
174
- Factory.define :menu_router do |m|
175
- m.load_functions 'some text value'
176
- m.to_arg_functions 'some text value'
177
- m.access_callback 'some string'
178
- m.page_callback 'some string'
179
- m.fit 7
180
- m.number_parts 7
181
- m.tab_parent 'some string'
182
- m.tab_root 'some string'
183
- m.title 'some string'
184
- m.title_callback 'some string'
185
- m.title_arguments 'some string'
186
- m.type 7
187
- m.block_callback 'some string'
188
- m.description 'some text value'
189
- m.position 'some string'
190
- m.weight 7
191
- end
192
-
193
- Factory.define :node do |n|
194
- n.vid 7
195
- n.type 'some string'
196
- n.language 'some string'
197
- n.title 'some string'
198
- n.uid 7
199
- n.status 7
200
- n.created 7
201
- n.changed 7
202
- n.comment 7
203
- n.promote 7
204
- n.moderate 7
205
- n.sticky 7
206
- n.tnid 7
207
- n.translate 7
208
- end
209
-
210
- Factory.define :node_access do |n|
211
- n.nid 7
212
- n.gid 7
213
- n.realm 'some string'
214
- n.grant_view 7
215
- n.grant_update 7
216
- n.grant_delete 7
217
- end
218
-
219
- Factory.define :node_comment_statistic do |n|
220
- n.last_comment_timestamp 7
221
- n.last_comment_uid 7
222
- n.comment_count 7
223
- end
224
-
225
- Factory.define :node_counter do |n|
226
- n.totalcount 7
227
- n.daycount 7
228
- n.timestamp 7
229
- end
230
-
231
- Factory.define :node_revision do |n|
232
- n.nid 7
233
- n.uid 7
234
- n.title 'some string'
235
- n.body 'some text value'
236
- n.teaser 'some text value'
237
- n.log 'some text value'
238
- n.timestamp 7
239
- n.format 7
240
- end
241
-
242
- Factory.define :node_type do |n|
243
- n.name 'some string'
244
- n.module 'some string'
245
- n.description 'some text value'
246
- n.help 'some text value'
247
- n.has_title 7
248
- n.title_label 'some string'
249
- n.has_body 7
250
- n.body_label 'some string'
251
- n.min_word_count 7
252
- n.custom 7
253
- n.modified 7
254
- n.locked 7
255
- n.orig_type 'some string'
256
- end
257
-
258
- Factory.define :permission do |p|
259
- p.rid 7
260
- p.tid 7
261
- end
262
-
263
- Factory.define :role do |r|
264
- r.name 'some string'
265
- end
266
-
267
- Factory.define :session do |s|
268
- s.uid 7
269
- s.hostname 'some string'
270
- s.timestamp 7
271
- s.cache 7
272
- end
273
-
274
- Factory.define :system do |s|
275
- s.name 'some string'
276
- s.type 'some string'
277
- s.owner 'some string'
278
- s.status 7
279
- s.throttle 7
280
- s.bootstrap 7
281
- s.schema_version 7
282
- s.weight 7
283
- end
284
-
285
- Factory.define :term_data do |t|
286
- t.vid 7
287
- t.name 'some string'
288
- t.weight 7
289
- end
96
+ Factory.define :comment do |comment|
97
+ comment.pid 7
98
+ comment.nid 7
99
+ comment.uid 7
100
+ comment.subject 'some string'
101
+ comment.comment 'some text value'
102
+ comment.hostname 'some string'
103
+ comment.timestamp 7
104
+ comment.status 7
105
+ comment.format 7
106
+ comment.thread 'some string'
107
+ end
108
+
109
+ Factory.define :uploaded_files do |uploaded_files|
110
+ uploaded_files.uid 7
111
+ uploaded_files.filename 'some string'
112
+ uploaded_files.filepath 'some string'
113
+ uploaded_files.filemime 'some string'
114
+ uploaded_files.filesize 7
115
+ uploaded_files.status 7
116
+ uploaded_files.timestamp 7
117
+ end
118
+
119
+ Factory.define :filter_format do |filter_format|
120
+ filter_format.name 'some string'
121
+ filter_format.roles 'some string'
122
+ filter_format.cache 7
123
+ end
124
+
125
+ Factory.define :filter do |filter|
126
+ filter.format 7
127
+ filter.module 'some string'
128
+ filter.delta 7
129
+ filter.weight 7
130
+ end
131
+
132
+ Factory.define :flood do |flood|
133
+ flood.event 'some string'
134
+ flood.hostname 'some string'
135
+ flood.timestamp 7
136
+ end
137
+
138
+ Factory.define :history do |history|
139
+ history.uid 7
140
+ history.nid 7
141
+ history.timestamp 7
142
+ end
143
+
144
+ Factory.define :menu_custom do |menu_custom|
145
+ menu_custom.title 'some string'
146
+ end
147
+
148
+ Factory.define :menu_link do |menu_link|
149
+ menu_link.menu_name 'some string'
150
+ menu_link.plid 7
151
+ menu_link.link_path 'some string'
152
+ menu_link.router_path 'some string'
153
+ menu_link.link_title 'some string'
154
+ menu_link.module 'some string'
155
+ menu_link.hidden 7
156
+ menu_link.external 7
157
+ menu_link.has_children 7
158
+ menu_link.expanded 7
159
+ menu_link.weight 7
160
+ menu_link.depth 7
161
+ menu_link.customized 7
162
+ menu_link.p1 7
163
+ menu_link.p2 7
164
+ menu_link.p3 7
165
+ menu_link.p4 7
166
+ menu_link.p5 7
167
+ menu_link.p6 7
168
+ menu_link.p7 7
169
+ menu_link.p8 7
170
+ menu_link.p9 7
171
+ menu_link.updated 7
172
+ end
173
+
174
+ Factory.define :menu_router do |menu_router|
175
+ menu_router.load_functions 'some text value'
176
+ menu_router.to_arg_functions 'some text value'
177
+ menu_router.access_callback 'some string'
178
+ menu_router.page_callback 'some string'
179
+ menu_router.fit 7
180
+ menu_router.number_parts 7
181
+ menu_router.tab_parent 'some string'
182
+ menu_router.tab_root 'some string'
183
+ menu_router.title 'some string'
184
+ menu_router.title_callback 'some string'
185
+ menu_router.title_arguments 'some string'
186
+ menu_router.type 7
187
+ menu_router.block_callback 'some string'
188
+ menu_router.description 'some text value'
189
+ menu_router.position 'some string'
190
+ menu_router.weight 7
191
+ end
192
+
193
+ Factory.define :node do |node|
194
+ node.vid 7
195
+ node.type 'some string'
196
+ node.language 'some string'
197
+ node.title 'some string'
198
+ node.uid 7
199
+ node.status 7
200
+ node.created 7
201
+ node.changed 7
202
+ node.comment 7
203
+ node.promote 7
204
+ node.moderate 7
205
+ node.sticky 7
206
+ node.tnid 7
207
+ node.translate 7
208
+ end
209
+
210
+ Factory.define :node_access do |node_access|
211
+ node_access.nid 7
212
+ node_access.gid 7
213
+ node_access.realm 'some string'
214
+ node_access.grant_view 7
215
+ node_access.grant_update 7
216
+ node_access.grant_delete 7
217
+ end
218
+
219
+ Factory.define :node_comment_statistic do |node_comment_statistic|
220
+ node_comment_statistic.last_comment_timestamp 7
221
+ node_comment_statistic.last_comment_uid 7
222
+ node_comment_statistic.comment_count 7
223
+ end
224
+
225
+ Factory.define :node_counter do |node_counter|
226
+ node_counter.totalcount 7
227
+ node_counter.daycount 7
228
+ node_counter.timestamp 7
229
+ end
230
+
231
+ Factory.define :node_revision do |node_revision|
232
+ node_revision.nid 7
233
+ node_revision.uid 7
234
+ node_revision.title 'some string'
235
+ node_revision.body 'some text value'
236
+ node_revision.teaser 'some text value'
237
+ node_revision.log 'some text value'
238
+ node_revision.timestamp 7
239
+ node_revision.format 7
240
+ end
241
+
242
+ Factory.define :node_type do |node_type|
243
+ node_type.name 'some string'
244
+ node_type.module 'some string'
245
+ node_type.description 'some text value'
246
+ node_type.help 'some text value'
247
+ node_type.has_title 7
248
+ node_type.title_label 'some string'
249
+ node_type.has_body 7
250
+ node_type.body_label 'some string'
251
+ node_type.min_word_count 7
252
+ node_type.custom 7
253
+ node_type.modified 7
254
+ node_type.locked 7
255
+ node_type.orig_type 'some string'
256
+ end
257
+
258
+ Factory.define :permission do |permission|
259
+ permission.rid 7
260
+ permission.tid 7
261
+ end
262
+
263
+ Factory.define :role do |role|
264
+ role.name 'some string'
265
+ end
266
+
267
+ Factory.define :session do |session|
268
+ session.uid 7
269
+ session.hostname 'some string'
270
+ session.timestamp 7
271
+ session.cache 7
272
+ end
273
+
274
+ Factory.define :system do |system|
275
+ system.name 'some string'
276
+ system.type 'some string'
277
+ system.owner 'some string'
278
+ system.status 7
279
+ system.throttle 7
280
+ system.bootstrap 7
281
+ system.schema_version 7
282
+ system.weight 7
283
+ end
284
+
285
+ Factory.define :term_data do |term_data|
286
+ term_data.vid 7
287
+ term_data.name 'some string'
288
+ term_data.weight 7
289
+ end
290
290
 
291
- Factory.define :term_hierarchy do |t|
292
- t.tid 7
293
- t.parent 7
294
- end
295
-
296
- Factory.define :term_node do |t|
297
- t.nid 7
298
- t.vid 7
299
- t.tid 7
291
+ Factory.define :term_hierarchy do |term_hierarchy|
292
+ term_hierarchy.tid 7
293
+ term_hierarchy.parent 7
294
+ end
295
+
296
+ Factory.define :term_node do |term_node|
297
+ term_node.nid 7
298
+ term_node.vid 7
299
+ term_node.tid 7
300
300
  end
301
301
 
302
- Factory.define :term_relation do |t|
303
- t.tid1 7
304
- t.tid2 7
302
+ Factory.define :term_relation do |term_relation|
303
+ term_relation.tid1 7
304
+ term_relation.tid2 7
305
305
  end
306
306
 
307
- Factory.define :term_synonym do |t|
308
- t.tid 7
309
- t.name 'some string'
307
+ Factory.define :term_synonym do |term_synonym|
308
+ term_synonym.tid 7
309
+ term_synonym.name 'some string'
310
310
  end
311
311
 
312
- Factory.define :url_alias do |u|
313
- u.src 'some string'
314
- u.dst 'some string'
315
- u.language 'some string'
312
+ Factory.define :url_alias do |url_alias|
313
+ url_alias.src 'some string'
314
+ url_alias.dst 'some string'
315
+ url_alias.language 'some string'
316
316
  end
317
317
 
318
- Factory.define :user do |u|
319
- u.name 'some string'
320
- u.pass 'some string'
321
- u.mode 7
322
- u.theme 'some string'
323
- u.signature 'some string'
324
- u.signature_format 7
325
- u.created 7
326
- u.access 7
327
- u.login 7
328
- u.status 7
329
- u.language 'some string'
330
- u.picture 'some string'
318
+ Factory.define :user do |user|
319
+ user.name 'some string'
320
+ user.pass 'some string'
321
+ user.mode 7
322
+ user.theme 'some string'
323
+ user.signature 'some string'
324
+ user.signature_format 7
325
+ user.created 7
326
+ user.access 7
327
+ user.login 7
328
+ user.status 7
329
+ user.language 'some string'
330
+ user.picture 'some string'
331
331
  end
332
332
 
333
- Factory.define :users_role do |u|
334
- u.uid 7
335
- u.rid 7
333
+ Factory.define :users_role do |users_role|
334
+ users_role.uid 7
335
+ users_role.rid 7
336
336
  end
337
337
 
338
- Factory.define :variable do |v|
339
- v.value 'some text value'
338
+ Factory.define :variable do |variable|
339
+ variable.value 'some text value'
340
340
  end
341
341
 
342
- Factory.define :vocabulary do |v|
343
- v.name 'some string'
344
- v.help 'some string'
345
- v.relations 7
346
- v.hierarchy 7
347
- v.multiple 7
348
- v.required 7
349
- v.tags 7
350
- v.module 'some string'
351
- v.weight 7
342
+ Factory.define :vocabulary do |vocabulary|
343
+ vocabulary.name 'some string'
344
+ vocabulary.help 'some string'
345
+ vocabulary.relations 7
346
+ vocabulary.hierarchy 7
347
+ vocabulary.multiple 7
348
+ vocabulary.required 7
349
+ vocabulary.tags 7
350
+ vocabulary.module 'some string'
351
+ vocabulary.weight 7
352
352
  end
353
353
 
354
- Factory.define :vocabulary_node_type do |v|
355
- v.vid 7
356
- v.type 'some string'
354
+ Factory.define :vocabulary_node_type do |vocabulary_node_type|
355
+ vocabulary_node_type.vid 7
356
+ vocabulary_node_type.type 'some string'
357
357
  end
358
358
 
359
- Factory.define :watchdog do |w|
360
- w.uid 7
361
- w.type 'some string'
362
- w.message 'some text value'
363
- w.variables 'some text value'
364
- w.severity 7
365
- w.link 'some string'
366
- w.location 'some text value'
367
- w.hostname 'some string'
368
- w.timestamp 7
359
+ Factory.define :watchdog do |watchdog|
360
+ watchdog.uid 7
361
+ watchdog.type 'some string'
362
+ watchdog.message 'some text value'
363
+ watchdog.variables 'some text value'
364
+ watchdog.severity 7
365
+ watchdog.link 'some string'
366
+ watchdog.location 'some text value'
367
+ watchdog.hostname 'some string'
368
+ watchdog.timestamp 7
369
369
  end
370
370