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
t.add :delete_at
t.add :trash_at
t.add :is_trashed
+ t.add :properties
end
def maybe_invalidate_permissions_cache
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
true
end
-
end