Module: Decidim::TranslatableAttributes

Extended by:
ActiveSupport::Concern
Included in:
Amendable::Form, BaseDiffRenderer, Events::BaseEvent, FormBuilder, NotificationToMailerPresenter, ResourcePresenter, ScopesHelper, TranslationBarCell, TranslationsHelper, UserPresenter
Defined in:
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 '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