seed_helper 1.0.2 → 1.0.3
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 +4 -4
- data/lib/seed_helper.rb +6 -2
- 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: ab52b2e5a7fff890695ec26efd1f37d5e6a30edc
|
4
|
+
data.tar.gz: 1fb3023b9fe4156967102fa9c60aedd2bb09c815
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c11a08ce89e5b95c69a594a8ecd802f3514f04cf77a5700c32131cb99783f982d8db31cc906442655cd31eec5f579dd714993b2256dcadf5109fc754f09d4ec
|
7
|
+
data.tar.gz: 4f8b17d3e1257ea2373ea2191b051823715421f5e95649cb2b65d2a46a524852b451c9d4dcf05240bf34a89fe3ed8e6d220f09e55c9079f784d9d2e3d4da016b
|
data/lib/seed_helper.rb
CHANGED
@@ -26,12 +26,16 @@ module SeedHelper
|
|
26
26
|
private
|
27
27
|
|
28
28
|
def find_resource(resource_class, attributes)
|
29
|
+
# Can't search for password
|
30
|
+
cloned_attributes = attributes.dup
|
31
|
+
cloned_attributes.delete(:password)
|
32
|
+
cloned_attributes.delete(:password_confirmation)
|
29
33
|
# Rails 4
|
30
34
|
if resource_class.respond_to?(:find_by)
|
31
|
-
return resource_class.find_by(
|
35
|
+
return resource_class.find_by(cloned_attributes)
|
32
36
|
# Rails 3
|
33
37
|
else
|
34
|
-
return resource_class.where(
|
38
|
+
return resource_class.where(cloned_attributes).first
|
35
39
|
end
|
36
40
|
end
|
37
41
|
|
data/lib/seed_helper/version.rb
CHANGED