seed_helper 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/seed_helper.rb +8 -3
- data/lib/seed_helper/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1999cdb1bbeab9291a462801c9ca11a8d35bbeb
|
4
|
+
data.tar.gz: 00177d5b7b15ce3bcb1abeec8c155725c021c523
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1dc7f06ec62cf0650d81414b2bae0009cf18e3e30ba5af4c2eccc90aeb7718fdb53d2d945bb081149d8a771f2c7ccc9697451a2922ab09cf0726a075ef5bd0d5
|
7
|
+
data.tar.gz: 7e1ad125713ceaced531ab612d93db2e690bb16e6b8105f5e0c92ce2d73c8defaedb5e0abc4dcd70d5f77e2d88b603f915e4f2521bbc114b2fcb6898814897a1
|
data/lib/seed_helper.rb
CHANGED
@@ -26,10 +26,15 @@ module SeedHelper
|
|
26
26
|
private
|
27
27
|
|
28
28
|
def find_resource(resource_class, attributes)
|
29
|
-
# Can't search for password
|
30
29
|
cloned_attributes = attributes.dup
|
31
|
-
cloned_attributes.
|
32
|
-
|
30
|
+
cloned_attributes.delete_if do |key, value|
|
31
|
+
# Can't search for password
|
32
|
+
[:password, :password_confirmation].include?(key) ||
|
33
|
+
# Times are bad for searches
|
34
|
+
value.kind_of?(Time) ||
|
35
|
+
value.kind_of?(Date)
|
36
|
+
end
|
37
|
+
debugger
|
33
38
|
# Rails 4
|
34
39
|
if resource_class.respond_to?(:find_by)
|
35
40
|
return resource_class.find_by(cloned_attributes)
|
data/lib/seed_helper/version.rb
CHANGED