effective_resources 1.4.13 → 1.5.0

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
  SHA256:
3
- metadata.gz: 26fb7f4bb20f9558578037580acce364d1069fdb99210ef0e2b533874a9f9d6a
4
- data.tar.gz: 98d7be06b5bae25e286eebf1e48607ccf4e235eade22ecbd2c622e24c5f09301
3
+ metadata.gz: 96ca5cf766ce1834be39c1cc4698eed91291824f5cc242fcd4daa5f287bcbe95
4
+ data.tar.gz: 3297962f09ef0490a3c53ccd3eb7d82858ed0a553a935e8ce264a7947c70fcdb
5
5
  SHA512:
6
- metadata.gz: 1d0484e04a8f4159a40af9c25d4ecac702f5c37c6ddd6323817a2cedb2840604feb7276791382518ff7a79e87a1b3934e539a5a60956d336ec35039767f13993
7
- data.tar.gz: 67c2b83cce754e80b998241cc463d1c7b8b93049a53169dd4ab92d7c6acdc99043d922f9912b0df206b063fcf727ef479f40c9fbedaf0c58ee5788a7f517cb4e
6
+ metadata.gz: a88337e14e4d6df602ec530a07e57a48ac345fc25ade3c5ebaf34b9038c67decb76e17f58f7c431c0bd58e64cb589dfd0b4f4f3055b6082fb4f1b2e68f9f0ad2
7
+ data.tar.gz: cb339dd8e0a39d7e0c78e483a0d122c4b7de0d682f031ec91cf1d9a2184fe527e96278edbd92176d18564d5bb6c9f7edacd4f0336b4eb222682bed52153f991d
@@ -75,11 +75,11 @@ module Effective
75
75
  when :date, :datetime
76
76
  if (digits = value.to_s.scan(/(\d+)/).flatten).present?
77
77
  date = if digits.first.length == 4 # 2017-01-10
78
- Time.zone.local(*digits)
78
+ (Time.zone.local(*digits) rescue nil)
79
79
  else # 01/10/2016
80
80
  year = digits.find { |d| d.length == 4}
81
81
  digits = [year] + (digits - [year])
82
- Time.zone.local(*digits)
82
+ (Time.zone.local(*digits) rescue nil)
83
83
  end
84
84
 
85
85
  name.to_s.start_with?('end_') ? date.end_of_day : date
@@ -87,7 +87,7 @@ module Effective
87
87
  when :time
88
88
  if (digits = value.to_s.scan(/(\d+)/).flatten).present?
89
89
  now = Time.zone.now
90
- Time.zone.local(now.year, now.month, now.day, *digits)
90
+ (Time.zone.local(now.year, now.month, now.day, *digits) rescue nil)
91
91
  end
92
92
  when :decimal, :currency
93
93
  (value.kind_of?(String) ? value.gsub(/[^0-9|\-|\.]/, '') : value).to_f
@@ -1,5 +1,4 @@
1
1
  require 'effective_resources/engine'
2
- require 'effective_resources/version'
3
2
 
4
3
  module EffectiveResources
5
4
 
@@ -3,9 +3,14 @@ module EffectiveResources
3
3
  engine_name 'effective_resources'
4
4
 
5
5
  config.autoload_paths += Dir[
6
- "#{config.root}/lib/",
7
6
  "#{config.root}/jobs/",
8
- "#{config.root}/app/models/validators/",
7
+ "#{config.root}/lib/validators/",
8
+ "#{config.root}/app/controllers/concerns/"
9
+ ]
10
+
11
+ config.eager_load_paths += Dir[
12
+ "#{config.root}/jobs/",
13
+ "#{config.root}/lib/validators/",
9
14
  "#{config.root}/app/controllers/concerns/"
10
15
  ]
11
16
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveResources
2
- VERSION = '1.4.13'.freeze
2
+ VERSION = '1.5.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.13
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-15 00:00:00.000000000 Z
11
+ date: 2020-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -71,9 +71,6 @@ files:
71
71
  - app/models/effective/resources/paths.rb
72
72
  - app/models/effective/resources/relation.rb
73
73
  - app/models/effective/resources/sql.rb
74
- - app/models/validators/email_cc_validator.rb
75
- - app/models/validators/email_validator.rb
76
- - app/models/validators/url_validator.rb
77
74
  - app/views/application/_flash.html.haml
78
75
  - app/views/application/create.js.erb
79
76
  - app/views/application/destroy.js.erb
@@ -94,6 +91,9 @@ files:
94
91
  - lib/effective_resources/engine.rb
95
92
  - lib/effective_resources/version.rb
96
93
  - lib/generators/effective_resources/install_generator.rb
94
+ - lib/validators/email_cc_validator.rb
95
+ - lib/validators/email_validator.rb
96
+ - lib/validators/url_validator.rb
97
97
  homepage: https://github.com/code-and-effect/effective_resources
98
98
  licenses:
99
99
  - MIT