Module: ActiveAdmin::Globalize3::ActiveRecordExtension

Defined in:
lib/active_admin/globalize3/active_record_extension.rb

Defined Under Namespace

Modules: Methods

Instance Method Summary collapse

Instance Method Details

#active_admin_translates(*args, &block) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/active_admin/globalize3/active_record_extension.rb', line 14

def active_admin_translates(*args, &block)
  translates(*args.dup)
  args.extract_options!

  if block
    translation_class.instance_eval &block
  end
  translation_class.attr_accessible :locale
  translation_class.attr_accessible *args

  if translation_class.respond_to? :friendly_id_config
    extend FriendlyId
    friendly_id :anything, use: :globalize3
  end

  attr_accessible :translations_attributes
  accepts_nested_attributes_for :translations, allow_destroy: true

  include Methods
end