Module: DynamicMigrations::NameHelper
- Defined in:
- lib/dynamic_migrations/name_helper.rb
Instance Method Summary collapse
Instance Method Details
#abbreviate_table_name(table_name) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/dynamic_migrations/name_helper.rb', line 5 def abbreviate_table_name table_name table_name_without_schema = table_name.to_s.split(".").last if table_name_without_schema.nil? raise "no table name provided" end table_name_without_schema.split("_").map { |v| v[0..2] }.join("_") end |