fixture_dependencies 1.2.5 → 1.2.6

Sign up to get free protection for your applications and to get access to all the features.
File without changes
@@ -0,0 +1,11 @@
1
+ module Merb
2
+ module Test
3
+ module World
4
+ class Webrat
5
+ def load(*args)
6
+ FixtureDependencies.load(*args)
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -141,7 +141,7 @@ class << FixtureDependencies
141
141
  model = model_name.camelize.constantize
142
142
  unless loaded[model_name.to_sym]
143
143
  puts "#{spaces}loading #{model.table_name}.yml" if verbose > 0
144
- load_yaml(model_name)
144
+ load_yaml(model_name)
145
145
  end
146
146
  mtype = model_type(model)
147
147
  model_method(:raise_model_error, mtype, "Couldn't use fixture #{record.inspect}") unless attributes = fixtures[model_name.to_sym][name.to_sym]
@@ -151,7 +151,8 @@ class << FixtureDependencies
151
151
  loading.pop
152
152
  return existing_obj
153
153
  end
154
- obj = model.new
154
+ obj = model.respond_to?(:sti_key) ? attributes[model.sti_key].to_s.camelize.constantize.new : model.new
155
+ puts "#{spaces}#{model} STI plugin detected, initializing instance of #{obj}" if (verbose > 1 && model.sti_dataset)
155
156
  many_associations = []
156
157
  attributes.each do |attr, value|
157
158
  if reflection = model_method(:reflection, mtype, model, attr.to_sym)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fixture_dependencies
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
- - 5
10
- version: 1.2.5
9
+ - 6
10
+ version: 1.2.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jeremy Evans
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-18 00:00:00 -07:00
18
+ date: 2011-01-03 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -26,10 +26,10 @@ executables: []
26
26
  extensions: []
27
27
 
28
28
  extra_rdoc_files:
29
- - LICENSE
29
+ - MIT-LICENSE
30
30
  files:
31
31
  - README
32
- - LICENSE
32
+ - MIT-LICENSE
33
33
  - lib/fixture_dependencies.rb
34
34
  - lib/fixture_dependencies_test_help.rb
35
35
  - lib/fixture_dependencies/sequel.rb
@@ -38,6 +38,7 @@ files:
38
38
  - lib/fixture_dependencies/test_unit/rails.rb
39
39
  - lib/fixture_dependencies/test_unit/sequel.rb
40
40
  - lib/fixture_dependencies/rspec/sequel.rb
41
+ - lib/fixture_dependencies/webrat/merb.rb
41
42
  has_rdoc: true
42
43
  homepage:
43
44
  licenses: []