r2822@asus: jeremy | 2005-07-04 21:14:30 -0700

silence warnings re. class redefinitions


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1687 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jeremy Kemper
2005-07-04 23:09:58 +00:00
parent 79455b6d45
commit ac412ef1c7
2 changed files with 9 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
require File.dirname(__FILE__) + '/../abstract_unit'
Customer = Struct.new("Customer", :name)
silence_warnings { Customer = Struct.new("Customer", :name) }
module Fun
class GamesController < ActionController::Base

View File

@@ -15,13 +15,15 @@ class ActiveRecordHelperTest < Test::Unit::TestCase
include ActionView::Helpers::UrlHelper
include ActionView::Helpers::FormTagHelper
Post = Struct.new("Post", :title, :author_name, :body, :secret, :written_on)
Post.class_eval do
alias_method :title_before_type_cast, :title unless respond_to?(:title_before_type_cast)
alias_method :body_before_type_cast, :body unless respond_to?(:body_before_type_cast)
alias_method :author_name_before_type_cast, :author_name unless respond_to?(:author_name_before_type_cast)
silence_warnings do
Post = Struct.new("Post", :title, :author_name, :body, :secret, :written_on)
Post.class_eval do
alias_method :title_before_type_cast, :title unless respond_to?(:title_before_type_cast)
alias_method :body_before_type_cast, :body unless respond_to?(:body_before_type_cast)
alias_method :author_name_before_type_cast, :author_name unless respond_to?(:author_name_before_type_cast)
end
Column = Struct.new("Column", :type, :name, :human_name)
end
Column = Struct.new("Column", :type, :name, :human_name)
def setup
@post = Post.new