Closed VivianChu closed 6 years ago
@mcritchlow @lsitu - I tried Longshou's suggestion before it doesn't work. I tried again today and still got that error. I think it's because it failed at this part https://github.com/ucsdlib/horton/blob/feature/ad_ldap/spec/controllers/batch_import_controller_spec.rb#L58 https://github.com/ucsdlib/horton/blob/develop/app/models/user.rb#L3
because it called hyrax:user model
1) BatchImportController Excel XL metadata source #create enqueue an update job is successful Failure/Error: log.success!
ActiveModel::UnknownAttributeError:
unknown attribute 'password' for User.
That's odd. Using @lsitu's suggestion, your just overriding the methods defined in the module in the included class.
Is there a stacktrace, or any additional info from byebug? I'm curious where/why it's bypassing the methods you're defining locally.
@mcritchlow - It related to the structure of the module hyrax:user
Here's the stack trace. It does call back to hyrax:user class. It doesn't use these methods in model/user.rb
# /Users/tchu/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/bundler/gems/hyrax-9f117a32a9fd/app/models/concerns/hyrax/user.rb:163:in `find_or_create_system_user'
# /Users/tchu/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/bundler/gems/hyrax-9f117a32a9fd/app/models/concerns/hyrax/user.rb:146:in `audit_user'
# /Users/tchu/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/bundler/gems/hyrax-9f117a32a9fd/app/services/hyrax/message_user_service.rb:27:in `job_user'
# /Users/tchu/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/bundler/gems/hyrax-9f117a32a9fd/app/services/hyrax/message_user_service.rb:11:in `call'
# /Users/tchu/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/bundler/gems/hyrax-9f117a32a9fd/config/initializers/hyrax_callbacks.rb:29:in `block in <top (required)>'
@VivianChu I've added a commit https://github.com/ucsdlib/horton/pull/139/commits/1f0bfdd1c1e85af2500ee1ddefd612043ea26eb1 that works in my local environment as we discussed this morning. Could you do a clean checkout to see whether it works for you?
@lsitu - It works for me. Thanks.
@ucsdlib/developers - please review, comment, etc... Thanks
@ucsdlib/developers - The commits have been merged for easier review. Thanks
:+1:
Fixes #125 ; refs #125
Implement SSO (authentication) + AD/LDAP (authorization).
@ucsdlib/developers - please review