Module: Decidim::TranslatableAttributes

Extended by:
ActiveSupport::Concern
Included in:
Accountability::Admin::ResultForm, Accountability::Admin::StatusForm, Accountability::Admin::TimelineEntryForm, Admin::AreaForm, Admin::AreaTypeForm, Admin::AttachmentCollectionForm, Admin::AttachmentForm, Admin::CategoryForm, Admin::ComponentForm, Admin::ContentBlockForm, Admin::HelpSectionForm, Admin::NewsletterForm, Admin::OfficializationForm, Admin::OrganizationAppearanceForm, Admin::OrganizationForm, Admin::ScopeForm, Admin::ScopeTypeForm, Admin::StaticPageForm, Admin::StaticPageTopicForm, Amendable::Form, Assemblies::Admin::AssembliesTypeForm, Assemblies::Admin::AssemblyCopyForm, Assemblies::Admin::AssemblyForm, Assemblies::Admin::AssemblyImportForm, BaseDiffRenderer, Blogs::Admin::PostForm, Budgets::Admin::BudgetForm, Budgets::Admin::ProjectForm, Comments::Comment, Conferences::Admin::ConferenceCopyForm, Conferences::Admin::ConferenceForm, Conferences::Admin::ConferenceRegistrationInviteForm, Conferences::Admin::ConferenceSpeakerForm, Conferences::Admin::MediaLinkForm, Conferences::Admin::RegistrationTypeForm, Consultations::Admin::ConsultationForm, Consultations::Admin::QuestionConfigurationForm, Consultations::Admin::QuestionForm, Consultations::Admin::ResponseForm, Consultations::Admin::ResponseGroupForm, Debates::Admin::CloseDebateForm, Debates::Admin::DebateForm, Debates::Debate, Debates::DebateForm, Debates::DebatePresenter, DummyResources::DummyResourcesController, Elections::Admin::AnswerForm, Elections::Admin::ElectionForm, Elections::Admin::QuestionForm, Elections::ElectionPresenter, Elections::VoteAcceptedMailer, Events::BaseEvent, FormBuilder, 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::InitiativeForm, Initiatives::InitiativesMailer, Initiatives::PreviousForm, Initiatives::VoteForm, InitiativesVote, Meetings::Admin::CloseMeetingForm, Meetings::Admin::MeetingAgendaForm, Meetings::Admin::MeetingAgendaItemsForm, Meetings::Admin::MeetingCopyForm, Meetings::Admin::MeetingForm, Meetings::Admin::MeetingRegistrationsForm, Meetings::Admin::MeetingServiceForm, Meetings::MeetingCellsHelper, Pages::Admin::PageForm, ParticipatoryProcesses::Admin::ParticipatoryProcessCopyForm, ParticipatoryProcesses::Admin::ParticipatoryProcessForm, ParticipatoryProcesses::Admin::ParticipatoryProcessGroupForm, ParticipatoryProcesses::Admin::ParticipatoryProcessImportForm, ParticipatoryProcesses::Admin::ParticipatoryProcessStepForm, Proposals::Admin::ImportParticipatoryTextForm, Proposals::Admin::ProposalAnswerForm, Proposals::Admin::ProposalBaseForm, Proposals::Admin::UpdateParticipatoryText, Proposals::Admin::UpdateProposalScope, Proposals::AdminLog::ValueTypes::ProposalTitleBodyPresenter, Proposals::CollaborativeDraftCellsHelper, Proposals::Proposal, Proposals::ProposalCellsHelper, Proposals::ProposalForm, Proposals::ProposalPresenter, ScopesHelper, Sortitions::Admin::DestroySortitionForm, Sortitions::Admin::EditSortitionForm, Sortitions::Admin::SortitionForm, System::UpdateOrganizationForm, Decidim::Templates::Admin::QuestionnaireTemplatesController, Decidim::Templates::Admin::TemplateForm, TranslationBarCell, TranslationsHelper, UserPresenter, Verifications::Admin::RevocationsBeforeDateForm, Verifications::IdDocuments::Admin::ConfigForm, Votings::AccessCodeMailer, Votings::Admin::PollingStationForm, Votings::Admin::VotingForm, Votings::AnswerResultForm, Votings::Census::AccessCodesExporter, Votings::Census::ExportMailer, 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 Virtus 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)

110
111
112
113
# File 'decidim-core/lib/decidim/translatable_attributes.rb', line 110

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