Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
RDMS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
researchdata
RDMS
Commits
a64c0b48
Commit
a64c0b48
authored
2 months ago
by
Anusha Ranganathan
Browse files
Options
Downloads
Patches
Plain Diff
Refactored code
parent
7721a653
Branches
bug_fix/443_improve_agreement_date_check
No related tags found
1 merge request
!368
Improve agreement date check
Pipeline
#19623
passed
2 months ago
Stage: build
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hyrax/app/models/user.rb
+5
-7
5 additions, 7 deletions
hyrax/app/models/user.rb
with
5 additions
and
7 deletions
hyrax/app/models/user.rb
+
5
−
7
View file @
a64c0b48
...
...
@@ -230,13 +230,11 @@ class User < ApplicationRecord
end
def
agreement_accepted?
if
ContentBlock
.
for
(
:terms
)
&
.
updated_at
.
present?
agreement_date
=
ContentBlock
.
for
(
:terms
)
&
.
updated_at
elsif
ContentBlock
.
for
(
:terms
)
&
.
created_at
.
present?
agreement_date
=
ContentBlock
.
for
(
:terms
)
&
.
created_at
else
agreement_date
=
DateTime
.
parse
(
ENV
.
fetch
(
"DEFAULT_AGREEMENT_DATE"
,
"2024-01-01"
))
end
term_of_uses
=
ContentBlock
.
for
(
:terms
)
default_agreement_date
=
DateTime
.
parse
(
ENV
.
fetch
(
"DEFAULT_AGREEMENT_DATE"
,
"2024-01-01"
))
agreement_date
=
term_of_uses
&
.
updated_at
||
term_of_uses
&
.
created_at
||
default_agreement_date
agreement_accepted_at
&&
(
agreement_accepted_at
>
agreement_date
)
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment