Class: Decidim::Admin::StaticPageForm

Inherits:
Form
  • Object
show all
Includes:
TranslatableAttributes
Defined in:
app/forms/decidim/admin/static_page_form.rb

Overview

A form object to create or update pages.

Instance Method Summary collapse

Instance Method Details

#control_public_access?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'app/forms/decidim/admin/static_page_form.rb', line 44

def control_public_access?
  current_organization.force_users_to_authenticate_before_access_organization?
end

#slugObject



27
28
29
# File 'app/forms/decidim/admin/static_page_form.rb', line 27

def slug
  super.to_s.downcase
end

#topicObject



31
32
33
34
35
36
# File 'app/forms/decidim/admin/static_page_form.rb', line 31

def topic
  @topic ||= StaticPageTopic.find_by(
    organization:,
    id: topic_id
  )
end

#topicsObject



38
39
40
41
42
# File 'app/forms/decidim/admin/static_page_form.rb', line 38

def topics
  @topics ||= StaticPageTopic.where(
    organization: current_organization
  )
end