Sha256: 83f45ff6ac4090f4c9b61f0fd84a845ddebf800c5a21172908af9757d800d9be

Contents?: true

Size: 987 Bytes

Versions: 8

Compression:

Stored size: 987 Bytes

Contents

# 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

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
railscart-0.0.1 starter-app/vendor/plugins/engines/lib/engines/rails_extensions/active_record.rb
railscart-0.0.2 starter_app/vendor/plugins/engines/lib/engines/rails_extensions/active_record.rb
railscart-0.0.3 starter_app/vendor/plugins/engines/lib/engines/rails_extensions/active_record.rb
railscart-0.0.4 starter_app/vendor/plugins/engines/lib/engines/rails_extensions/active_record.rb
spree-0.0.6 starter-app/vendor/plugins/engines/lib/engines/rails_extensions/active_record.rb
spree-0.0.5 starter-app/vendor/plugins/engines/lib/engines/rails_extensions/active_record.rb
spree-0.0.7 starter-app/vendor/plugins/engines/lib/engines/rails_extensions/active_record.rb
spree-0.0.8 starter-app/vendor/plugins/engines/lib/engines/rails_extensions/active_record.rb