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:
parent
6e1df2ca46
commit
44f85678e9
3 changed files with 18 additions and 36 deletions
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue