Class: ApplicationSetting::Term
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- ApplicationSetting::Term
- Includes:
- CacheMarkdownField
- Defined in:
- app/models/application_setting/term.rb
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
Class Method Summary collapse
Instance Method Summary collapse
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
Class Method Details
.latest ⇒ Object
13 14 15 |
# File 'app/models/application_setting/term.rb', line 13 def self.latest order(:id).last end |
Instance Method Details
#accepted_by_user?(user) ⇒ Boolean
17 18 19 20 21 22 |
# File 'app/models/application_setting/term.rb', line 17 def accepted_by_user?(user) return true if user.project_bot? user.accepted_term_id == id || term_agreements.accepted.where(user: user).exists? end |