Module: Decidim::TranslatableAttributes

Extended by:
ActiveSupport::Concern
Included in:
Accountability::Admin::ResultForm, Accountability::Admin::StatusForm, Accountability::Admin::TimelineEntryForm, Admin::AreaTypeForm, Admin::AttachmentCollectionForm, Admin::AttachmentForm, Admin::ComponentForm, Admin::ContentBlockForm, Admin::HelpSectionForm, Admin::NewsletterForm, Admin::OfficializationForm, Admin::OrganizationAppearanceForm, Admin::OrganizationForm, Admin::ScopeTypeForm, Admin::StaticPageTopicForm, Assemblies::Admin::AssembliesTypeForm, Budgets::Admin::BudgetForm, Budgets::Admin::ProjectForm, Budgets::Admin::UpdateProjectCategory, Comments::Comment, Conferences::Admin::ConferenceRegistrationInviteForm, Conferences::Admin::ConferenceSpeakerForm, Conferences::Admin::MediaLinkForm, Conferences::Admin::RegistrationTypeForm, Consultations::Admin::QuestionConfigurationForm, Consultations::Admin::ResponseForm, Consultations::Admin::ResponseGroupForm, Debates::Admin::DebateForm, DummyResources::DummyResourcesController, Elections::Admin::AnswerForm, Elections::Admin::ElectionForm, Elections::Admin::QuestionForm, Elections::ElectionPresenter, Elections::TrusteeMailer, Elections::VoteAcceptedMailer, Events::BaseEvent, Forms::Admin::AnswerOptionForm, Forms::Admin::DisplayConditionForm, Forms::Admin::QuestionForm, Forms::Admin::QuestionMatrixRowForm, Forms::Admin::QuestionnaireAnswerPresenter, Forms::Admin::QuestionnaireForm, Initiatives::Admin::InitiativeAnswerForm, Initiatives::Admin::InitiativeForm, Initiatives::Admin::InitiativeTypeForm, Initiatives::InitiativesMailer, Initiatives::PreviousForm, Meetings::Admin::AnswerOptionForm, Meetings::Admin::CloseMeetingForm, Meetings::Admin::MeetingAgendaForm, Meetings::Admin::MeetingAgendaItemsForm, Meetings::Admin::MeetingCopyForm, Meetings::Admin::MeetingForm, Meetings::Admin::MeetingRegistrationsForm, Meetings::Admin::MeetingServiceForm, Meetings::Admin::QuestionForm, Meetings::MeetingCellsHelper, Pages::Admin::PageForm, ParticipatoryProcesses::Admin::ParticipatoryProcessGroupForm, ParticipatoryProcesses::Admin::ParticipatoryProcessStepForm, ParticipatoryProcesses::Admin::ParticipatoryProcessTypeForm, Proposals::Admin::ImportParticipatoryTextForm, Proposals::Admin::ProposalAnswerForm, Proposals::Admin::ProposalBaseForm, Proposals::Admin::UpdateParticipatoryText, Proposals::Admin::UpdateProposalCategory, Proposals::AdminLog::ValueTypes::ProposalTitleBodyPresenter, Proposals::CollaborativeDraftCellsHelper, Proposals::ProposalCellsHelper, Proposals::ProposalForm, Sortitions::Admin::DestroySortitionForm, Sortitions::Admin::EditSortitionForm, Sortitions::Admin::SortitionForm, Decidim::Templates::Admin::QuestionnaireTemplatesController, Decidim::Templates::Admin::TemplateForm, TranslationBarCell, TranslationsHelper, Verifications::Admin::RevocationsBeforeDateForm, Verifications::IdDocuments::Admin::ConfigForm, Votings::Admin::PollingStationForm, Votings::AnswerResultForm, Votings::PollingStationPresenter, Votings::QuestionResultForm, Votings::VotingPresenter
Defined in:
decidim-core/lib/decidim/translatable_attributes.rb

Overview

A set of convenience methods to deal with I18n attributes and validations in a way that's compatible with AttributeObject and ActiveModel, thus making it easy to integrate into Rails' forms and similar workflows.

Instance Method Summary collapse

Instance Method Details

#default_locale?(locale) ⇒ Boolean

Returns:

  • (Boolean)

121
122
123
124
# File 'decidim-core/lib/decidim/translatable_attributes.rb', line 121

def default_locale?(locale)
  locale.to_s == try(:default_locale).to_s ||
    locale.to_s == try(:current_organization).try(:default_locale).to_s
end