Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Use the RailsComponent option method instead of a delegate

Dombi Attilaa51de7f99b2f
diff --git a/app/components/oauth/applications/row_component.rb b/app/components/oauth/applications/row_component.rb
index 375a6d5db4c..219120e7760 100644
--- a/app/components/oauth/applications/row_component.rb
+++ b/app/components/oauth/applications/row_component.rb
@@ -35,6 +35,8 @@ module OAuth
include ::OAuthHelper
include ::OpenProject::ObjectLinking
+ property :confidential
+
def application
model
end
@@ -66,8 +68,6 @@ module OAuth
end
end
- delegate :confidential, to: :application
-
def edit_link
link_to(
I18n.t(:button_edit),
diff --git a/modules/ldap_groups/app/components/ldap_groups/synchronized_filters/row_component.rb b/modules/ldap_groups/app/components/ldap_groups/synchronized_filters/row_component.rb
index 6bc1b250095..41f51864b77 100644
--- a/modules/ldap_groups/app/components/ldap_groups/synchronized_filters/row_component.rb
+++ b/modules/ldap_groups/app/components/ldap_groups/synchronized_filters/row_component.rb
@@ -34,6 +34,8 @@ module LdapGroups
include ::IconsHelper
include ::PasswordHelper
+ property :base_dn
+
def synchronized_filter
model
end
@@ -46,8 +48,6 @@ module LdapGroups
link_to synchronized_filter.auth_source.name, edit_ldap_auth_source_path(synchronized_filter.auth_source)
end
- delegate :base_dn, to: :synchronized_filter
-
def groups
synchronized_filter.groups.count
end