Module: Decidim::TranslatableAttributes

Overview

A set of convenience methods to deal with I18n attributes and validations in a way that is 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