seed_helper 1.0.3 → 1.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ab52b2e5a7fff890695ec26efd1f37d5e6a30edc
4
- data.tar.gz: 1fb3023b9fe4156967102fa9c60aedd2bb09c815
3
+ metadata.gz: e1999cdb1bbeab9291a462801c9ca11a8d35bbeb
4
+ data.tar.gz: 00177d5b7b15ce3bcb1abeec8c155725c021c523
5
5
  SHA512:
6
- metadata.gz: 2c11a08ce89e5b95c69a594a8ecd802f3514f04cf77a5700c32131cb99783f982d8db31cc906442655cd31eec5f579dd714993b2256dcadf5109fc754f09d4ec
7
- data.tar.gz: 4f8b17d3e1257ea2373ea2191b051823715421f5e95649cb2b65d2a46a524852b451c9d4dcf05240bf34a89fe3ed8e6d220f09e55c9079f784d9d2e3d4da016b
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.delete(:password)
32
- cloned_attributes.delete(:password_confirmation)
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)
@@ -1,3 +1,3 @@
1
1
  module SeedHelper
2
- VERSION = "1.0.3"
2
+ VERSION = "1.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seed_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordan Maguire