Skip to content

Commit

Permalink
Merge 5e183bd into b76fc88
Browse files Browse the repository at this point in the history
  • Loading branch information
cjcolvar committed Mar 4, 2019
2 parents b76fc88 + 5e183bd commit da6d29c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
Expand Up @@ -14,7 +14,7 @@ def assets_with_expired_embargoes
# (assumes that when lease visibility is applied to assets
# whose leases have expired, the lease expiration date will be removed from its metadata)
def assets_under_embargo
ActiveFedora::Base.where("#{Hydra.config.permissions.embargo.release_date}:*")
ActiveFedora::Base.where("#{Hydra.config.permissions.embargo.release_date}:[* TO *]")
end

# Returns all assets that have had embargoes deactivated in the past.
Expand Down
3 changes: 1 addition & 2 deletions hydra-access-controls/app/services/hydra/lease_service.rb
Expand Up @@ -10,7 +10,7 @@ def assets_with_expired_leases
# (assumes that when lease visibility is applied to assets
# whose leases have expired, the lease expiration date will be removed from its metadata)
def assets_under_lease
ActiveFedora::Base.where("#{Hydra.config.permissions.lease.expiration_date}:*")
ActiveFedora::Base.where("#{Hydra.config.permissions.lease.expiration_date}:[* TO *]")
end

# Returns all assets that have had embargoes deactivated in the past.
Expand All @@ -20,4 +20,3 @@ def assets_with_deactivated_leases
end
end
end

Expand Up @@ -29,7 +29,6 @@

describe "#assets_under_embargo" do
it "returns all assets with embargo release date set" do
result = subject.assets_under_embargo
returned_ids = subject.assets_under_embargo.map {|a| a.id}
expect(returned_ids).to include work_with_expired_embargo1.id, work_with_expired_embargo2.id, work_with_embargo_in_effect.id
expect(returned_ids).to_not include work_without_embargo.id
Expand Down

0 comments on commit da6d29c

Please sign in to comment.