Module: Txdb::Backends::Globalize::Helpers

Extended by:
Helpers
Included in:
Helpers, Reader, Writer, Iterators::GlobalizeIterator
Defined in:
lib/txdb/backends/globalize/helpers.rb

Instance Method Summary collapse

Instance Method Details

#origin_table_name(table_name) ⇒ Object



8
9
10
11
12
# File 'lib/txdb/backends/globalize/helpers.rb', line 8

def origin_table_name(table_name)
  ActiveSupport::Inflector.pluralize(
    table_name.sub(/_translations\z/, '')
  )
end

#resource_slug_for(table) ⇒ Object



14
15
16
# File 'lib/txdb/backends/globalize/helpers.rb', line 14

def resource_slug_for(table)
  Txgh::Utils.slugify("#{table.database.name}-#{table.name}")
end