fixturies 1.0.3 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/fixturies.rb +12 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 95b9e96f5a11eb6e20390fe38f5a786de44adf85930aa5218840d2e559144e7d
4
- data.tar.gz: e83b5b488b24fdbe24f464bdff10d59e916e96a18bdf4e6d319e174f44310747
3
+ metadata.gz: 279e30d4f553ebdb0d403f274a98f06e54a6c840fa9dc55174bb034dde2ecbba
4
+ data.tar.gz: 49b631dc9a872f6aee4ec661caf3d86eb18d8477ad5d03156064e811d93e9ae9
5
5
  SHA512:
6
- metadata.gz: 33c08b5e3804540d938d019024e001c601e8f55f6320518e2573f9500dbe0ad56fe4bc57418d96c922a95e6a70057b19d3d2304e4eb87888414eeebc6fbacdfb
7
- data.tar.gz: 4453b116af5b4ed500b78f0dc096c645a6709da2445770e00fe6cc23dbc684336d0279af8773a316140d894ce54b0d9a1ede02e26f5490ed53c5bb6d5e1dc6cd
6
+ metadata.gz: d9fc1681aed02de05c5bd3d63ff9ed42b361004702009b9b44b2c54454de29331d4902ffc7388b85e9635a329018c95e82be92a25205b16e426b99f7569ec08e
7
+ data.tar.gz: 48517251205ba71654688ef3c3b92f3ef7910591a204c09abc9d512dfa7e60e57dfa4a9aea6bbd2f827f4dd27b378e956edf756ed85ea047703c20ef8fd7e0b5
data/lib/fixturies.rb CHANGED
@@ -113,10 +113,20 @@ class Fixturies
113
113
  self.inheritance_column = nil # do not blow up if the type column indicates we should be using single-table inheritance
114
114
  }
115
115
 
116
+ virtual_column_names = klass.columns.filter_map do |column|
117
+ if column.try(:virtual?)
118
+ column.name
119
+ end
120
+ end
121
+
116
122
  hash = {}
117
123
  klass.all.each_with_index do |record, i|
118
124
  name = record_identifiers[record_key(record)] || "#{table_name.singularize}_#{i}"
119
- hash[name] = record.attributes
125
+ attributes = record.attributes
126
+ virtual_column_names.each do |column_name|
127
+ attributes.delete(column_name)
128
+ end
129
+ hash[name] = attributes
120
130
  end
121
131
 
122
132
  if hash.any?
@@ -145,4 +155,4 @@ class Fixturies
145
155
 
146
156
  end
147
157
 
148
- end
158
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fixturies
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nate Brustein
@@ -36,7 +36,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
36
36
  - !ruby/object:Gem::Version
37
37
  version: '0'
38
38
  requirements: []
39
- rubygems_version: 3.0.8
39
+ rubygems_version: 3.0.3.1
40
40
  signing_key:
41
41
  specification_version: 4
42
42
  summary: The speed of fixtures meets the maintanability of factories