1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

delete repeated code

This commit is contained in:
Aaron Patterson 2010-10-01 18:01:34 -07:00
parent 6e1df2ca46
commit 44f85678e9
3 changed files with 18 additions and 36 deletions

View file

@ -308,3 +308,21 @@ module ActionView
end
end
end
class Workshop
extend ActiveModel::Naming
include ActiveModel::Conversion
attr_accessor :id
def initialize(id)
@id = id
end
def persisted?
id.present?
end
def to_s
id.to_s
end
end

View file

@ -3,24 +3,6 @@ require 'abstract_unit'
class WorkshopsController < ActionController::Base
end
class Workshop
extend ActiveModel::Naming
include ActiveModel::Conversion
attr_accessor :id
def initialize(id)
@id = id
end
def persisted?
id.present?
end
def to_s
id.to_s
end
end
class RedirectController < ActionController::Base
def simple_redirect
redirect_to :action => "hello_world"

View file

@ -547,24 +547,6 @@ class LinkToUnlessCurrentWithControllerTest < ActionController::TestCase
end
end
class Workshop
extend ActiveModel::Naming
include ActiveModel::Conversion
attr_accessor :id
def initialize(id)
@id = id
end
def persisted?
id.present?
end
def to_s
id.to_s
end
end
class Session
extend ActiveModel::Naming
include ActiveModel::Conversion