GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Fork of halorgium/mephisto
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/zmack/mephisto.git
svenfuchs (author)
Wed Feb 20 11:11:20 -0800 2008
commit  1ad1b56b4a6c9284534b0afbb9d5d87715ae4312
tree    adc435b61f05728a991fd314188bc3e75cfb6038
parent  2772ec18227b04b3cb618748a2900a7b93b84d94
mephisto / vendor / plugins / engines / lib / engines / rails_extensions / active_record.rb
100644 25 lines (22 sloc) 0.987 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Here we add a single helpful method to ActiveRecord::Base. This method may be deprecated
# in the future, since support for the Module#config mechanism which required it has
# also been dropped.
module Engines::RailsExtensions::ActiveRecord
  # NOTE: Currently the Migrations system will ALWAYS wrap given table names
  # in the prefix/suffix, so any table name set via ActiveRecord::Base#set_table_name,
  # for instance will always get wrapped in the process of migration. For this
  # reason, whatever value you give to the config will be wrapped when set_table_name
  # is used in the model.
  #
  # This method is useful for determining the actual name (including prefix and
  # suffix) that Rails will use for a model, given a particular set_table_name
  # parameter.
  def wrapped_table_name(name)
    table_name_prefix + name + table_name_suffix
  end
  
end
 
module ::ActiveRecord #:nodoc:
  class Base #:nodoc:
    extend Engines::RailsExtensions::ActiveRecord
  end
end