seedomatic 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -38,7 +38,7 @@ module SeedOMatic
38
38
  attrs.select{|k| k.ends_with? "_lookup"}.each do |key, value|
39
39
  attrs.delete(key)
40
40
 
41
- association = key.gsub("_lookup", "")
41
+ association = key.gsub("_lookup", "").to_sym
42
42
  lookup_class = model_class.reflect_on_association(association).klass
43
43
 
44
44
  attrs[association] = lookup_class.where(value).first
@@ -1,3 +1,3 @@
1
1
  module Seedomatic
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
3
3
  end
@@ -46,7 +46,7 @@ describe SeedOMatic::Seeder do
46
46
  let(:items) { [{'name' => 'foo', 'category_lookup' => { 'code' => 'bar' }}]}
47
47
  let(:category) { MyCategory.new }
48
48
  specify {
49
- MyModel.should_receive(:reflect_on_association).with('category').and_return(OpenStruct.new(:klass => MyCategory))
49
+ MyModel.should_receive(:reflect_on_association).with(:category).and_return(OpenStruct.new(:klass => MyCategory))
50
50
  MyCategory.should_receive(:where).with(hash_including('code' => 'bar')).and_return(OpenStruct.new(:first => category))
51
51
  subject
52
52
  MyModel[0].category.should == category
@@ -24,6 +24,7 @@ class MyModel
24
24
  end
25
25
 
26
26
  def attributes=(attr)
27
+ attr = attr.with_indifferent_access
27
28
  self.name = attr['name']
28
29
  self.category = attr['category']
29
30
  self.category_lookup = attr['category_lookup']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seedomatic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-11 00:00:00.000000000 Z
12
+ date: 2012-05-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70294212636140 !ruby/object:Gem::Requirement
16
+ requirement: &70281206441820 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 2.9.0
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70294212636140
24
+ version_requirements: *70281206441820
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: activesupport
27
- requirement: &70294212635720 !ruby/object:Gem::Requirement
27
+ requirement: &70281206441400 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70294212635720
35
+ version_requirements: *70281206441400
36
36
  description: Create repeatable seed fixtures that you can continually use and deploy
37
37
  to multiple environments and tenants.
38
38
  email: