fanforce-internal-validations 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NzZiODRmZTI2MTU0MDg4ODQwYTgxNzI1YTcyOTZhYWYxMjdjZTNjZg==
4
+ YzM4MjJjN2I2ODI0OWYzMmY3YzZkZjlhOTljM2RjMGVjZjAxZDc0Yw==
5
5
  data.tar.gz: !binary |-
6
- NTI1OTQxYjZlOGQxZDk5YTA0NjA3OGI4MmQwNzYxYzgyNDExN2Q4YQ==
6
+ ZjVhYThjMTU4ZDM4MzI5ZDg5ZTAyMmUwYmE4ZjAzZTg4YjFjNzVlNA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MTE0MGU2NmNhODVlMDIyMjk0N2ViNjgwOTAxNTZjNDBhZTA5ZDQ4ZmRhMWRh
10
- ZGUwMTgyZmNmZjJkNzA2NjY0NDI2NDAxODEzMTIwYWQ2ZDcwZmQ3MTM2Njc3
11
- MTNiZDM3ODg3OWI4YzI4NDQ2Mjc2YTRhYjdiOGE0MjE3NjMyMjE=
9
+ MTg5MjA3Yjc3YzQ1NmI4NGM0N2FiMjljZGMzN2IwZjY5YTY0MmE0NzI2NDky
10
+ YzkwMGYwY2RiM2IxZDVkMzNjMTBkMDljMzAxMTk3M2YwNDBiMDBmYWI2MWJi
11
+ MGQwOGUzNTIyODMzOTk2MjEwNTUxNGE2MTBhMDZhOTFiYzEwMTg=
12
12
  data.tar.gz: !binary |-
13
- ZjI3OWEzMTc1ZmRhZmVjOGYxZmUzM2VmMTljZGU5M2I4NmY1MDcyYTgzMDE0
14
- ZjBhMDQ5MzBiMDcwNGEyNTE3NDM4MWZlNGU3OWViMmU1Y2VjNjE4NGM5OGVi
15
- ZDc4ODgyMTQxM2NlZWM4ZTYzNGFhZThhMGVhMTQwNGIyMDk0MDg=
13
+ ZGJmMmFkMzBjNDQ1NmJjNGNhZGE1NGE5ODVkZWM5YWU3ZjZiNmRmYzQwZTQ2
14
+ NzYwZjEzMjQyZTE1MzFjNzhjZTIyODMyMTBiNzdiNWQyOWQ2NmEwZWY5Zjdm
15
+ NGZjNzk4MzMxNzY4N2E2YTBkOGNjNDE1YzljMTczYWQ1NjE2OWI=
@@ -75,7 +75,7 @@ module Fanforce::Validations
75
75
 
76
76
  def format_validation_error(opts, fields, default_error_code=nil)
77
77
  error = {
78
- resource: is_present?(opts[:resource]) ? opts[:resource] : self.class.name.demodulize.tableize.singularize,
78
+ resource: is_present?(opts[:resource]) ? opts[:resource] : (self.class==Class ? self.name.demodulize.tableize.singularize : self.class.name.demodulize.tableize.singularize),
79
79
  code: is_present?(opts[:code]) ? opts[:code] : default_error_code,
80
80
  message: opts[:message]
81
81
  }
@@ -1,5 +1,5 @@
1
1
  class Fanforce
2
2
  module Validations
3
- VERSION = '0.1.5'
3
+ VERSION = '0.1.6'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fanforce-internal-validations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Caleb Clark