fixture_dependencies 1.3.1 → 1.3.2

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 51d6a769605c9429a06c1115981b3e98fc807000
4
+ data.tar.gz: df6cdf75fa74485b4193c88d749b0e840b0f309a
5
+ SHA512:
6
+ metadata.gz: 04f2119db18fa714df0737c1c51b9c0a194028a260150f3210c1ccd8d76cb5b411cfa9e506c1021460e51bc1075a384ce7c0be0ef0a1c1e0fee391f4d1c2c995
7
+ data.tar.gz: 3ef4e002212633c581395b3698f3686791b0e9009e37bffab79fb4e88f45b170a8e995770e6899b9f090299084f059b4f467de58290977ddb641ea20820fdd81
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2007-2012 Jeremy Evans
1
+ Copyright (c) 2007-2013 Jeremy Evans
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
@@ -154,7 +154,14 @@ class << FixtureDependencies
154
154
  loading.pop
155
155
  return existing_obj
156
156
  end
157
- obj = model.respond_to?(:sti_key) ? attributes[model.sti_key].to_s.camelize.constantize.new : model.new
157
+ if model.respond_to?(:sti_load)
158
+ obj = model.sti_load(model.sti_key => attributes[model.sti_key])
159
+ obj.send(:initialize)
160
+ elsif model.respond_to?(:sti_key)
161
+ obj = attributes[model.sti_key].to_s.camelize.constantize.new
162
+ else
163
+ obj = model.new
164
+ end
158
165
  puts "#{spaces}#{model} STI plugin detected, initializing instance of #{obj}" if (verbose > 1 && model.respond_to?(:sti_dataset))
159
166
  many_associations = []
160
167
  attributes.each do |attr, value|
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fixture_dependencies
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
5
- prerelease:
4
+ version: 1.3.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Jeremy Evans
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-06-04 00:00:00.000000000 Z
11
+ date: 2013-08-21 00:00:00.000000000 Z
13
12
  dependencies: []
14
13
  description:
15
14
  email: code@jeremyevans.net
@@ -29,8 +28,10 @@ files:
29
28
  - lib/fixture_dependencies/test_unit/sequel.rb
30
29
  - lib/fixture_dependencies/rspec/sequel.rb
31
30
  - lib/fixture_dependencies/webrat/merb.rb
32
- homepage:
33
- licenses: []
31
+ homepage: https://github.com/jeremyevans/fixture_dependencies
32
+ licenses:
33
+ - MIT
34
+ metadata: {}
34
35
  post_install_message:
35
36
  rdoc_options:
36
37
  - --inline-source
@@ -40,21 +41,19 @@ rdoc_options:
40
41
  require_paths:
41
42
  - lib
42
43
  required_ruby_version: !ruby/object:Gem::Requirement
43
- none: false
44
44
  requirements:
45
- - - ! '>='
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  required_rubygems_version: !ruby/object:Gem::Requirement
49
- none: false
50
49
  requirements:
51
- - - ! '>='
50
+ - - '>='
52
51
  - !ruby/object:Gem::Version
53
52
  version: '0'
54
53
  requirements: []
55
54
  rubyforge_project:
56
- rubygems_version: 1.8.11
55
+ rubygems_version: 2.0.3
57
56
  signing_key:
58
- specification_version: 3
57
+ specification_version: 4
59
58
  summary: Sequel/ActiveRecord fixture loader that handles dependency graphs
60
59
  test_files: []