fixturies 1.0.3 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fixturies.rb +12 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 279e30d4f553ebdb0d403f274a98f06e54a6c840fa9dc55174bb034dde2ecbba
|
4
|
+
data.tar.gz: 49b631dc9a872f6aee4ec661caf3d86eb18d8477ad5d03156064e811d93e9ae9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
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.
|
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
|