diff options
author | Akira Matsuda <ronnie@dio.jp> | 2017-01-13 15:09:56 +0900 |
---|---|---|
committer | Akira Matsuda <ronnie@dio.jp> | 2017-01-13 15:13:47 +0900 |
commit | 9360b6be63b7a452535699bcf6ae853df7f5eea7 (patch) | |
tree | d1ad1280439883cf0fb328efe45e09dfa581182f /actionview/test/actionpack | |
parent | be5ddc250874e6c7f4d22e34791f5187448ebb0e (diff) | |
download | rails-9360b6be63b7a452535699bcf6ae853df7f5eea7.tar.gz rails-9360b6be63b7a452535699bcf6ae853df7f5eea7.tar.bz2 rails-9360b6be63b7a452535699bcf6ae853df7f5eea7.zip |
class Foo < Struct.new(:x) creates an extra unneeded anonymous class
because Struct.new returns a Class, we just can give it a name and use it directly without inheriting from it
Diffstat (limited to 'actionview/test/actionpack')
-rw-r--r-- | actionview/test/actionpack/controller/render_test.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionview/test/actionpack/controller/render_test.rb b/actionview/test/actionpack/controller/render_test.rb index b4a757d6b8..890041914c 100644 --- a/actionview/test/actionpack/controller/render_test.rb +++ b/actionview/test/actionpack/controller/render_test.rb @@ -5,7 +5,7 @@ class ApplicationController < ActionController::Base self.view_paths = File.join(FIXTURE_LOAD_PATH, "actionpack") end -class Customer < Struct.new(:name, :id) +Customer = Struct.new(:name, :id) do extend ActiveModel::Naming include ActiveModel::Conversion @@ -39,7 +39,7 @@ end module Quiz #Models - class Question < Struct.new(:name, :id) + Question = Struct.new(:name, :id) do extend ActiveModel::Naming include ActiveModel::Conversion |