Module: Decidim::TranslatableAttributes

Extended by:
ActiveSupport::Concern
Included in:
Amendable::Form, BaseDiffRenderer, Events::BaseEvent, FormBuilder, 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 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 '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