static public Method

Base.class_name(table_name = table_name)

Turns the table_name back into a class name following the reverse rules of table_name.

Source Code

# File active_record/base.rb, line 1054
def class_name(table_name = table_name) # :nodoc:
  # remove any prefix and/or suffix from the table name
  class_name = table_name[table_name_prefix.length..-(table_name_suffix.length + 1)].camelize
  class_name = class_name.singularize if pluralize_table_names
  class_name
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.