model_driven_api 3.3.1 → 3.4.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: 0751f2c240c15ab7130628b14469555a3fb1abf74e80fba20c86b6a588c4d2db
4
- data.tar.gz: 573b9acc768a3162a449e3c70890a1ab5be0e2b124eca9d0d3f6a25fc9928aba
3
+ metadata.gz: 0ecd0e3a3b7a279fb9a68b6ac3fe513ada2aa9875807cc672fa5a8f4d690fb1d
4
+ data.tar.gz: 926640daa632265835dc91e24d4062ed3678c91972aa5d6de53c2c8939511c4d
5
5
  SHA512:
6
- metadata.gz: ace22af5f8fd756d69b251d4576997e907e38c275706960aa3b31a2149c63744506792f5995e604b0ec68fd08f8bae2f256e4013a43af7ae10a10474c018eaba
7
- data.tar.gz: 961a3a7b3378981df8078b6b7369cc8eb1fb3cada953553de4e2cf2f677583ec6050a968bd3d6d85b483279ca9d24b9796ae06f5d8448bec944f6ca2fc601d2a
6
+ metadata.gz: aa235f9c25f6abcb48d724f68f9a726bf38c1dd90bd7aab6c292fdf78ecab4df142f806337b6782595ba19484481d230020880e2376ed44f62d207f736026acd
7
+ data.tar.gz: 984146f876ba9b9267855f9099a316641efbd65131191e680e933ccbeb013d3bac51ec287c41e9a886a815f312866f579fcf0a8d3cb795e7b1b6538960b5e058
@@ -37,6 +37,9 @@ class AuthenticateUser
37
37
  user = nil if user.blank? || user.authenticate(password).blank?
38
38
  end
39
39
 
40
+ #Try to authenticate the user against LDAP if user is not present at this point
41
+ user = Ldap::Authenticator.new(email: email, password: password).authenticate if user.blank?
42
+
40
43
  raise AccessDenied unless user.present?
41
44
 
42
45
  return user
@@ -87,8 +87,10 @@ class Api::V2::ApplicationController < ActionController::API
87
87
  return render json: result, status: (status_number.presence || 200) if status == true
88
88
 
89
89
  # Normal Update Action
90
- # Rails 6 vs Rails 6.1
91
- @record.respond_to?("update_attributes!") ? @record.update_attributes!(@body) : @record.update!(@body)
90
+ # Use save! to be sure to raise an exception if the record is not valid and to trigger all the callbacks for the model during update
91
+ Rails.logger.debug("############################## Updating record #{@record}")
92
+ @record.update!(@body)
93
+
92
94
  render json: @record.to_json(json_attrs), status: 200
93
95
  end
94
96
 
@@ -1,3 +1,3 @@
1
1
  module ModelDrivenApi
2
- VERSION = "3.3.1".freeze
2
+ VERSION = "3.4.0".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: model_driven_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.1
4
+ version: 3.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni