validate :ensure_hash_matches_manifest_text
# Query only undeleted collections by default.
- default_scope { where("expires_at IS NULL or expires_at > CURRENT_TIMESTAMP") }
+ default_scope where("expires_at IS NULL or expires_at > CURRENT_TIMESTAMP")
api_accessible :user, extend: :common do |t|
t.add :name
properties text,
state character varying(255),
components_summary text,
- description text,
started_at timestamp without time zone,
- finished_at timestamp without time zone
+ finished_at timestamp without time zone,
+ description text
);
INSERT INTO schema_migrations (version) VALUES ('20140909183946');
-INSERT INTO schema_migrations (version) VALUES ('20140911221252');
+INSERT INTO schema_migrations (version) VALUES ('20140911221252');
\ No newline at end of file
end
end
end
+ # default_trash_lifetime cannot be less than 24 hours
+ if $application_config['default_trash_lifetime'] < 86400 then
+ raise "default_trash_lifetime is %d, must be at least 86400" % $application_config['default_trash_lifetime']
+ end
end
end
expired_collection:
uuid: zzzzz-4zz18-mto52zx1s7sn3ih
portable_data_hash: 0b21a217243bfce5617fb9224b95bcb9+49
- owner_uuid: zzzzz-tpzed-000000000000000
+ owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz
created_at: 2014-02-03T17:22:54Z
modified_by_client_uuid: zzzzz-ozdt8-brczlopd8u8d0jr
modified_by_user_uuid: zzzzz-tpzed-d9tiejq69daie8f
collection_expires_in_future:
uuid: zzzzz-4zz18-padkqo7yb8d9i3j
portable_data_hash: 0b21a217243bfce5617fb9224b95bcb9+49
- owner_uuid: zzzzz-tpzed-000000000000000
+ owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz
created_at: 2014-02-03T17:22:54Z
modified_by_client_uuid: zzzzz-ozdt8-brczlopd8u8d0jr
modified_by_user_uuid: zzzzz-tpzed-d9tiejq69daie8f
head_uuid: zzzzz-4zz18-y9vne9npefyxh8g
properties: {}
-expired_collection_readable_by_active:
- uuid: zzzzz-o0j2j-e3cq2eg21va67ud
- owner_uuid: zzzzz-tpzed-000000000000000
- created_at: 2014-01-24 20:42:26 -0800
- modified_by_client_uuid: zzzzz-ozdt8-brczlopd8u8d0jr
- modified_by_user_uuid: zzzzz-tpzed-000000000000000
- modified_at: 2014-01-24 20:42:26 -0800
- updated_at: 2014-01-24 20:42:26 -0800
- tail_uuid: zzzzz-tpzed-xurymjxw79nv3jz
- link_class: permission
- name: can_read
- head_uuid: zzzzz-4zz18-mto52zx1s7sn3ih
- properties: {}
-
-unexpired_collection_readable_by_active:
- uuid: zzzzz-o0j2j-4undx2cussodkkg
- owner_uuid: zzzzz-tpzed-000000000000000
- created_at: 2014-01-24 20:42:26 -0800
- modified_by_client_uuid: zzzzz-ozdt8-brczlopd8u8d0jr
- modified_by_user_uuid: zzzzz-tpzed-000000000000000
- modified_at: 2014-01-24 20:42:26 -0800
- updated_at: 2014-01-24 20:42:26 -0800
- tail_uuid: zzzzz-tpzed-xurymjxw79nv3jz
- link_class: permission
- name: can_read
- head_uuid: zzzzz-4zz18-padkqo7yb8d9i3j
- properties: {}
-
barbaz_job_readable_by_spectator:
uuid: zzzzz-o0j2j-cpy7p41hpk531e1
owner_uuid: zzzzz-tpzed-000000000000000
end
test 'Expired collections are not returned' do
- permit_unsigned_manifests
authorize_with :active
get :index, {
where: {name: 'expired_collection'},
assert_response :success
found = assigns(:objects)
assert_equal 0, found.count
+
+ get :show, {
+ id: 'zzzzz-4zz18-mto52zx1s7sn3ih',
+ }
+ assert_response 404
+
+ post :update, {
+ id: 'zzzzz-4zz18-mto52zx1s7sn3ih',
+ collection: {
+ name: "still expired"
+ }
+ }
+ assert_response 404
end
test 'Collection with future expiration time is returned' do
- permit_unsigned_manifests
authorize_with :active
get :index, {
where: {name: 'collection_expires_in_future'},
}
found = assigns(:objects)
assert_equal 1, found.count
+
+ get :show, {
+ id: 'zzzzz-4zz18-padkqo7yb8d9i3j',
+ }
+ assert_success
+
+ post :update, {
+ id: 'zzzzz-4zz18-padkqo7yb8d9i3j',
+ collection: {
+ name: "still not expired"
+ }
+ }
+ assert_success
end
end