Class: Namespace::Detail
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Namespace::Detail
- Includes:
- CacheMarkdownField
- Defined in:
- app/models/namespace/detail.rb
Overview
rubocop:disable Gitlab/BoundedContexts -- TODO refactor to use bounded context
Constant Summary
Constants included from CacheMarkdownField
CacheMarkdownField::INVALIDATED_BY
Constants inherited from ApplicationRecord
Constants included from HasCheckConstraints
HasCheckConstraints::NOT_NULL_CHECK_PATTERN
Constants included from ResetOnColumnErrors
ResetOnColumnErrors::MAX_RESET_PERIOD
Instance Attribute Summary
Attributes included from CacheMarkdownField
#skip_markdown_cache_validation
Instance Method Summary collapse
-
#add_creator(user) ⇒ Object
This method should not be called directly.
Methods included from CacheMarkdownField
#attribute_invalidated?, #banzai_render_context, #cached_html_for, #cached_html_up_to_date?, #can_cache_field?, #invalidated_markdown_cache?, #latest_cached_markdown_version, #mentionable_attributes_changed?, #mentioned_filtered_user_ids_for, #parent_user, #refresh_markdown_cache, #refresh_markdown_cache!, #rendered_field_content, #skip_project_check?, #store_mentions!, #store_mentions?, #store_mentions_after_commit?, #updated_cached_html_for
Methods inherited from ApplicationRecord
===, cached_column_list, #create_or_load_association, current_transaction, declarative_enum, default_select_columns, delete_all_returning, #deleted_from_database?, id_in, id_not_in, iid_in, nullable_column?, primary_key_in, #readable_by?, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, #to_ability_name, underscore, where_exists, where_not_exists, with_fast_read_statement_timeout, without_order
Methods included from Organizations::Sharding
Methods included from ResetOnColumnErrors
#reset_on_union_error, #reset_on_unknown_attribute_error
Methods included from Gitlab::SensitiveSerializableHash
Instance Method Details
#add_creator(user) ⇒ Object
This method should not be called directly. Instead, it is available on the namespace via delegation and should be called after the namespace is saved. Failure to do so will result in errors due to a database trigger that automatically creates the namespace_details after a namespace is created. If we attempt to build the namespace details before the namespace is saved, the trigger will fire and rails will subsequently try to create the namespace_details which will result in an error due to a primary key conflict. Any other modifications to the namespace details should be performed after the associated namespace is saved for the same reason.
33 34 35 |
# File 'app/models/namespace/detail.rb', line 33 def add_creator(user) update_attribute(:creator, user) end |