Class: Board
Constant Summary
collapse
- RECENT_BOARDS_SIZE =
4
ApplicationRecord::MAX_PLUCK
HasCheckConstraints::NOT_NULL_CHECK_PATTERN
ResetOnColumnErrors::MAX_RESET_PERIOD
Class Method Summary
collapse
Instance Method Summary
collapse
===, cached_column_list, #create_or_load_association, declarative_enum, default_select_columns, id_in, id_not_in, iid_in, nullable_column?, pluck_primary_key, 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
#reset_on_union_error, #reset_on_unknown_attribute_error
#serializable_hash
Class Method Details
.to_type ⇒ Object
45
46
47
|
# File 'app/models/board.rb', line 45
def self.to_type
name.demodulize
end
|
Instance Method Details
#disabled_for?(current_user) ⇒ Boolean
53
54
55
56
57
|
# File 'app/models/board.rb', line 53
def disabled_for?(current_user)
namespace = group_board? ? resource_parent.root_ancestor : resource_parent.root_namespace
namespace.issue_repositioning_disabled? || !Ability.allowed?(current_user, :create_non_backlog_issues, self)
end
|
#group_board? ⇒ Boolean
33
34
35
|
# File 'app/models/board.rb', line 33
def group_board?
group_id.present?
end
|
#project_board? ⇒ Boolean
37
38
39
|
# File 'app/models/board.rb', line 37
def project_board?
project_id.present?
end
|
#project_needed? ⇒ Boolean
25
26
27
|
# File 'app/models/board.rb', line 25
def project_needed?
!group
end
|
#resource_parent ⇒ Object
29
30
31
|
# File 'app/models/board.rb', line 29
def resource_parent
@resource_parent ||= group || project
end
|
#scoped? ⇒ Boolean
41
42
43
|
# File 'app/models/board.rb', line 41
def scoped?
false
end
|
#to_type ⇒ Object
49
50
51
|
# File 'app/models/board.rb', line 49
def to_type
self.class.to_type
end
|