railties 4.1.0.beta2 → 4.1.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +65 -4
  3. data/lib/rails/app_rails_loader.rb +1 -1
  4. data/lib/rails/application.rb +11 -9
  5. data/lib/rails/application/bootstrap.rb +5 -1
  6. data/lib/rails/application/configuration.rb +13 -5
  7. data/lib/rails/commands/dbconsole.rb +11 -5
  8. data/lib/rails/commands/runner.rb +14 -5
  9. data/lib/rails/engine.rb +0 -1
  10. data/lib/rails/generators/actions.rb +8 -8
  11. data/lib/rails/generators/actions/create_migration.rb +68 -0
  12. data/lib/rails/generators/app_base.rb +7 -67
  13. data/lib/rails/generators/base.rb +1 -1
  14. data/lib/rails/generators/erb.rb +5 -1
  15. data/lib/rails/generators/erb/controller/controller_generator.rb +4 -2
  16. data/lib/rails/generators/erb/mailer/mailer_generator.rb +2 -2
  17. data/lib/rails/generators/erb/mailer/templates/view.html.erb +5 -0
  18. data/lib/rails/generators/erb/mailer/templates/view.text.erb +1 -1
  19. data/lib/rails/generators/erb/scaffold/scaffold_generator.rb +4 -2
  20. data/lib/rails/generators/migration.rb +22 -16
  21. data/lib/rails/generators/rails/app/app_generator.rb +5 -7
  22. data/lib/rails/generators/rails/app/templates/Gemfile +2 -4
  23. data/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt +6 -6
  24. data/lib/rails/generators/rails/app/templates/config/databases/frontbase.yml +3 -2
  25. data/lib/rails/generators/rails/app/templates/config/databases/ibm_db.yml +3 -2
  26. data/lib/rails/generators/rails/app/templates/config/databases/jdbc.yml +3 -2
  27. data/lib/rails/generators/rails/app/templates/config/databases/jdbcmysql.yml +3 -3
  28. data/lib/rails/generators/rails/app/templates/config/databases/jdbcpostgresql.yml +12 -4
  29. data/lib/rails/generators/rails/app/templates/config/databases/jdbcsqlite3.yml +3 -2
  30. data/lib/rails/generators/rails/app/templates/config/databases/mysql.yml +8 -3
  31. data/lib/rails/generators/rails/app/templates/config/databases/oracle.yml +3 -2
  32. data/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml +16 -4
  33. data/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml +7 -2
  34. data/lib/rails/generators/rails/app/templates/config/databases/sqlserver.yml +3 -2
  35. data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +8 -0
  36. data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +7 -2
  37. data/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +4 -1
  38. data/lib/rails/generators/rails/app/templates/config/initializers/cookies_serializer.rb +3 -0
  39. data/lib/rails/generators/rails/app/templates/config/secrets.yml +3 -1
  40. data/lib/rails/generators/rails/app/templates/test/test_helper.rb +1 -3
  41. data/lib/rails/generators/rails/controller/controller_generator.rb +3 -3
  42. data/lib/rails/generators/rails/plugin/plugin_generator.rb +1 -4
  43. data/lib/rails/generators/rails/plugin/templates/Gemfile +2 -4
  44. data/lib/rails/generators/rails/plugin/templates/bin/rails.tt +4 -0
  45. data/lib/rails/generators/rails/resource_route/resource_route_generator.rb +1 -1
  46. data/lib/rails/generators/resource_helpers.rb +1 -3
  47. data/lib/rails/generators/test_unit/mailer/templates/preview.rb +2 -0
  48. data/lib/rails/paths.rb +1 -1
  49. data/lib/rails/railtie.rb +3 -3
  50. data/lib/rails/test_help.rb +3 -1
  51. data/lib/rails/test_unit/testing.rake +0 -1
  52. data/lib/rails/version.rb +1 -1
  53. metadata +10 -7
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -16,5 +16,7 @@ development:
16
16
  test:
17
17
  secret_key_base: <%= app_secret %>
18
18
 
19
+ # Do not keep production secrets in the repository,
20
+ # instead read values from the environment.
19
21
  production:
20
- secret_key_base: <%= app_secret %>
22
+ secret_key_base: <%%= ENV["SECRET_KEY_BASE"] %>
@@ -1,11 +1,9 @@
1
- ENV["RAILS_ENV"] ||= "test"
1
+ ENV['RAILS_ENV'] ||= 'test'
2
2
  require File.expand_path('../../config/environment', __FILE__)
3
3
  require 'rails/test_help'
4
4
 
5
5
  class ActiveSupport::TestCase
6
6
  <% unless options[:skip_active_record] -%>
7
- ActiveRecord::Migration.check_pending!
8
-
9
7
  # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
10
8
  #
11
9
  # Note: You'll currently still have to declare fixtures explicitly in integration tests
@@ -23,7 +23,7 @@ module Rails
23
23
  # Will generate -
24
24
  # namespace :foo do
25
25
  # namespace :bar do
26
- # get "baz/index"
26
+ # get 'baz/index'
27
27
  # end
28
28
  # end
29
29
  def generate_routing_code(action)
@@ -36,8 +36,8 @@ module Rails
36
36
  end.join
37
37
 
38
38
  # Create route
39
- # get "baz/index"
40
- route = indent(%{get "#{file_name}/#{action}"\n}, depth * 2)
39
+ # get 'baz/index'
40
+ route = indent(%{get '#{file_name}/#{action}'\n}, depth * 2)
41
41
 
42
42
  # Create `end` ladder
43
43
  # end
@@ -185,7 +185,6 @@ task default: :test
185
185
  end
186
186
 
187
187
  public_task :set_default_accessors!
188
- public_task :apply_rails_template
189
188
  public_task :create_root
190
189
 
191
190
  def create_root_files
@@ -242,6 +241,7 @@ task default: :test
242
241
  build(:leftovers)
243
242
  end
244
243
 
244
+ public_task :apply_rails_template, :run_bundle
245
245
 
246
246
  def name
247
247
  @name ||= begin
@@ -255,9 +255,6 @@ task default: :test
255
255
  end
256
256
  end
257
257
 
258
- public_task :run_bundle
259
- public_task :replay_template
260
-
261
258
  protected
262
259
 
263
260
  def app_templates_dir
@@ -29,12 +29,10 @@ end
29
29
 
30
30
  # <%= gem.comment %>
31
31
  <% end -%>
32
- <%= gem.commented_out ? '# ' : '' %>gem '<%= gem.name %>'<% if gem.version -%>
33
- , '<%= gem.version %>'
34
- <% elsif gem.options.any? -%>
32
+ <%= gem.commented_out ? '# ' : '' %>gem '<%= gem.name %>'<%= %(, '#{gem.version}') if gem.version -%>
33
+ <% if gem.options.any? -%>
35
34
  ,<%= gem.padding(max_width) %><%= gem.options.map { |k,v|
36
35
  "#{k}: #{v.inspect}" }.join(', ') %>
37
- <% else %>
38
36
  <% end -%>
39
37
  <% end -%>
40
38
 
@@ -3,5 +3,9 @@
3
3
  ENGINE_ROOT = File.expand_path('../..', __FILE__)
4
4
  ENGINE_PATH = File.expand_path('../../lib/<%= name -%>/engine', __FILE__)
5
5
 
6
+ # Set up gems listed in the Gemfile.
7
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
8
+ require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
9
+
6
10
  require 'rails/all'
7
11
  require 'rails/engine/commands'
@@ -9,7 +9,7 @@ module Rails
9
9
  # should give you
10
10
  #
11
11
  # namespace :admin do
12
- # namespace :users
12
+ # namespace :users do
13
13
  # resources :products
14
14
  # end
15
15
  # end
@@ -15,12 +15,10 @@ module Rails
15
15
  # Set controller variables on initialization.
16
16
  def initialize(*args) #:nodoc:
17
17
  super
18
+ controller_name = name
18
19
  if options[:model_name]
19
- controller_name = name
20
20
  self.name = options[:model_name]
21
21
  assign_names!(self.name)
22
- else
23
- controller_name = name
24
22
  end
25
23
 
26
24
  if name == name.pluralize && name.singularize != name.pluralize && !options[:force_plural]
@@ -1,7 +1,9 @@
1
1
  <% module_namespacing do -%>
2
+ # Preview all emails at http://localhost:3000/rails/mailers/<%= file_path %>
2
3
  class <%= class_name %>Preview < ActionMailer::Preview
3
4
  <% actions.each do |action| -%>
4
5
 
6
+ # Preview this email at http://localhost:3000/rails/mailers/<%= file_path %>/<%= action %>
5
7
  def <%= action %>
6
8
  <%= class_name %>.<%= action %>
7
9
  end
@@ -24,7 +24,7 @@ module Rails
24
24
  #
25
25
  # Notice that when you add a path using +add+, the path object created already
26
26
  # contains the path with the same path value given to +add+. In some situations,
27
- # you may not want this behavior, so you can give :with as option.
27
+ # you may not want this behavior, so you can give <tt>:with</tt> as option.
28
28
  #
29
29
  # root.add "config/routes", with: "config/routes.rb"
30
30
  # root["config/routes"].inspect # => ["config/routes.rb"]
@@ -22,7 +22,7 @@ module Rails
22
22
  #
23
23
  # * creating initializers
24
24
  # * configuring a Rails framework for the application, like setting a generator
25
- # * +adding config.*+ keys to the environment
25
+ # * adding <tt>config.*</tt> keys to the environment
26
26
  # * setting up a subscriber with ActiveSupport::Notifications
27
27
  # * adding rake tasks
28
28
  #
@@ -63,8 +63,8 @@ module Rails
63
63
  # end
64
64
  # end
65
65
  #
66
- # Finally, you can also pass :before and :after as option to initializer, in case
67
- # you want to couple it with a specific step in the initialization process.
66
+ # Finally, you can also pass <tt>:before</tt> and <tt>:after</tt> as option to initializer,
67
+ # in case you want to couple it with a specific step in the initialization process.
68
68
  #
69
69
  # == Configuration
70
70
  #
@@ -11,10 +11,12 @@ require 'rails/generators/test_case'
11
11
  # Config Rails backtrace in tests.
12
12
  require 'rails/backtrace_cleaner'
13
13
  if ENV["BACKTRACE"].nil?
14
- MiniTest.backtrace_filter = Rails.backtrace_cleaner
14
+ Minitest.backtrace_filter = Rails.backtrace_cleaner
15
15
  end
16
16
 
17
17
  if defined?(ActiveRecord::Base)
18
+ ActiveRecord::Migration.maintain_test_schema!
19
+
18
20
  class ActiveSupport::TestCase
19
21
  include ActiveRecord::TestFixtures
20
22
  self.fixture_path = "#{Rails.root}/test/fixtures/"
@@ -1,4 +1,3 @@
1
- require 'rbconfig'
2
1
  require 'rake/testtask'
3
2
  require 'rails/test_unit/sub_test_task'
4
3
 
@@ -3,7 +3,7 @@ module Rails
3
3
  MAJOR = 4
4
4
  MINOR = 1
5
5
  TINY = 0
6
- PRE = "beta2"
6
+ PRE = "rc1"
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railties
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.0.beta2
4
+ version: 4.1.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 4.1.0.beta2
19
+ version: 4.1.0.rc1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 4.1.0.beta2
26
+ version: 4.1.0.rc1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: actionpack
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 4.1.0.beta2
33
+ version: 4.1.0.rc1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 4.1.0.beta2
40
+ version: 4.1.0.rc1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -78,14 +78,14 @@ dependencies:
78
78
  requirements:
79
79
  - - '='
80
80
  - !ruby/object:Gem::Version
81
- version: 4.1.0.beta2
81
+ version: 4.1.0.rc1
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - '='
87
87
  - !ruby/object:Gem::Version
88
- version: 4.1.0.beta2
88
+ version: 4.1.0.rc1
89
89
  description: 'Rails internals: application bootup, plugins, generators, and rake tasks.'
90
90
  email: david@loudthinking.com
91
91
  executables:
@@ -133,6 +133,7 @@ files:
133
133
  - lib/rails/engine/railties.rb
134
134
  - lib/rails/generators.rb
135
135
  - lib/rails/generators/actions.rb
136
+ - lib/rails/generators/actions/create_migration.rb
136
137
  - lib/rails/generators/active_model.rb
137
138
  - lib/rails/generators/app_base.rb
138
139
  - lib/rails/generators/base.rb
@@ -143,6 +144,7 @@ files:
143
144
  - lib/rails/generators/erb/controller/controller_generator.rb
144
145
  - lib/rails/generators/erb/controller/templates/view.html.erb
145
146
  - lib/rails/generators/erb/mailer/mailer_generator.rb
147
+ - lib/rails/generators/erb/mailer/templates/view.html.erb
146
148
  - lib/rails/generators/erb/mailer/templates/view.text.erb
147
149
  - lib/rails/generators/erb/scaffold/scaffold_generator.rb
148
150
  - lib/rails/generators/erb/scaffold/templates/_form.html.erb
@@ -187,6 +189,7 @@ files:
187
189
  - lib/rails/generators/rails/app/templates/config/environments/production.rb.tt
188
190
  - lib/rails/generators/rails/app/templates/config/environments/test.rb.tt
189
191
  - lib/rails/generators/rails/app/templates/config/initializers/backtrace_silencers.rb
192
+ - lib/rails/generators/rails/app/templates/config/initializers/cookies_serializer.rb
190
193
  - lib/rails/generators/rails/app/templates/config/initializers/filter_parameter_logging.rb
191
194
  - lib/rails/generators/rails/app/templates/config/initializers/inflections.rb
192
195
  - lib/rails/generators/rails/app/templates/config/initializers/mime_types.rb