projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix typo.
[arvados.git]
/
services
/
api
/
app
/
models
/
group.rb
diff --git
a/services/api/app/models/group.rb
b/services/api/app/models/group.rb
index 861800d2093878c3cd16011e4eac1c0cee3ae18d..7fb8fef42ba9e4c1b19967174cd30c9991383726 100644
(file)
--- a/
services/api/app/models/group.rb
+++ b/
services/api/app/models/group.rb
@@
-12,6
+12,10
@@
class Group < ArvadosModel
include CanBeAnOwner
include Trashable
include CanBeAnOwner
include Trashable
+ # Posgresql JSONB columns should NOT be declared as serialized, Rails 5
+ # already know how to properly treat them.
+ attribute :properties, :jsonbHash, default: {}
+
after_create :invalidate_permissions_cache
after_update :maybe_invalidate_permissions_cache
before_create :assign_name
after_create :invalidate_permissions_cache
after_update :maybe_invalidate_permissions_cache
before_create :assign_name
@@
-24,10
+28,11
@@
class Group < ArvadosModel
t.add :delete_at
t.add :trash_at
t.add :is_trashed
t.add :delete_at
t.add :trash_at
t.add :is_trashed
+ t.add :properties
end
def maybe_invalidate_permissions_cache
end
def maybe_invalidate_permissions_cache
- if uuid_changed? or owner_uuid_changed?
+ if uuid_changed? or owner_uuid_changed?
or is_trashed_changed?
# This can change users' permissions on other groups as well as
# this one.
invalidate_permissions_cache
# This can change users' permissions on other groups as well as
# this one.
invalidate_permissions_cache
@@
-37,7
+42,7
@@
class Group < ArvadosModel
def invalidate_permissions_cache
# Ensure a new group can be accessed by the appropriate users
# immediately after being created.
def invalidate_permissions_cache
# Ensure a new group can be accessed by the appropriate users
# immediately after being created.
- User.invalidate_permissions_cache
db_current_time.to_i
+ User.invalidate_permissions_cache
self.async_permissions_update
end
def assign_name
end
def assign_name
@@
-46,5
+51,4
@@
class Group < ArvadosModel
end
true
end
end
true
end
-
end
end