railties 4.2.0 → 4.2.1.rc1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 55baacf9acdd0d42344c849d3b057fbc89ac979d
4
- data.tar.gz: 9ade7f6a3318f7aad6227abcc28c18bece50ebb1
3
+ metadata.gz: 10dc40c7374d5bd5c36a87aa0806a13753b3c3f4
4
+ data.tar.gz: 7c7988dab5d9a5bb70e610328baa573a78bf75dd
5
5
  SHA512:
6
- metadata.gz: eae7ddad125a425b93487bd646b65c1fa058d73ee993cdd1729a7bc631d61a1ed6466a7ef5bad146e9bf27d5f7afd02af2c4dc27d5a93590ce27f0e9c5ec569d
7
- data.tar.gz: 23e2210d29927128d38510c7c6ccc73d3c199d2aaed0e8eaa8a4233a3e14d128a70eba2ecf1b28c39b0310aa2c6908953b19781286aa206d6c57c199bed2ab35
6
+ metadata.gz: 9a72ac84fbaf55ebe47be46ee77f4967358ffefd92ccb78607b0aba8f1b6bcfc3e43e6fc4fcbbf3fee20e222a132abeebe328c235bfa195dd180d808656630f5
7
+ data.tar.gz: 330732b41a529befb7c41f1f1e7458d7e250aeb1028fb099e6601ae9f460d0c1360d18035b416582616a9f43020211576cd899b3bf3a97141bfa15857c4612d8
@@ -1,3 +1,20 @@
1
+ * Force generated routes to be inserted into routes.rb
2
+
3
+ *Andrew White*
4
+
5
+ * Don't remove all line endings from routes.rb when revoking scaffold.
6
+
7
+ Fixes #15913.
8
+
9
+ *Andrew White*
10
+
11
+ * Fix scaffold generator with `--helper=false` option.
12
+
13
+ *Rafael Mendonça França*
14
+
15
+
16
+ ## Rails 4.2.0 (December 20, 2014) ##
17
+
1
18
  * Deprecate `config.serve_static_assets` in favor of `config.serve_static_files`
2
19
  to clarify that the option is unrelated to the asset pipeline.
3
20
 
@@ -368,7 +368,21 @@ module Rails
368
368
  @config = configuration
369
369
  end
370
370
 
371
- def secrets #:nodoc:
371
+ # Returns secrets added to config/secrets.yml.
372
+ #
373
+ # Example:
374
+ #
375
+ # development:
376
+ # secret_key_base: 836fa3665997a860728bcb9e9a1e704d427cfc920e79d847d79c8a9a907b9e965defa4154b2b86bdec6930adbe33f21364523a6f6ce363865724549fdfc08553
377
+ # test:
378
+ # secret_key_base: 5a37811464e7d378488b0f073e2193b093682e4e21f5d6f3ae0a4e1781e61a351fdc878a843424e81c73fb484a40d23f92c8dafac4870e74ede6e5e174423010
379
+ # production:
380
+ # secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
381
+ # namespace: my_app_production
382
+ #
383
+ # +Rails.application.secrets.namespace+ returns +my_app_production+ in the
384
+ # production environment.
385
+ def secrets
372
386
  @secrets ||= begin
373
387
  secrets = ActiveSupport::OrderedOptions.new
374
388
  yaml = config.paths["config/secrets"].first
@@ -571,10 +571,10 @@ module Rails
571
571
  end
572
572
 
573
573
  initializer :add_routing_paths do |app|
574
- paths = self.paths["config/routes.rb"].existent
574
+ routing_paths = self.paths["config/routes.rb"].existent
575
575
 
576
- if routes? || paths.any?
577
- app.routes_reloader.paths.unshift(*paths)
576
+ if routes? || routing_paths.any?
577
+ app.routes_reloader.paths.unshift(*routing_paths)
578
578
  app.routes_reloader.route_sets << routes
579
579
  end
580
580
  end
@@ -7,8 +7,8 @@ module Rails
7
7
  module VERSION
8
8
  MAJOR = 4
9
9
  MINOR = 2
10
- TINY = 0
11
- PRE = nil
10
+ TINY = 1
11
+ PRE = "rc1"
12
12
 
13
13
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
14
14
  end
@@ -219,10 +219,10 @@ module Rails
219
219
  # route "root 'welcome#index'"
220
220
  def route(routing_code)
221
221
  log :route, routing_code
222
- sentinel = /\.routes\.draw do\s*$/
222
+ sentinel = /\.routes\.draw do\s*\n/m
223
223
 
224
224
  in_root do
225
- inject_into_file 'config/routes.rb', "\n #{routing_code}", { after: sentinel, verbose: false }
225
+ inject_into_file 'config/routes.rb', " #{routing_code}", { after: sentinel, verbose: false, force: true }
226
226
  end
227
227
  end
228
228
 
@@ -159,6 +159,10 @@ module Rails
159
159
  options.delete(:required)
160
160
  options[:null] = false
161
161
  end
162
+
163
+ if reference? && !polymorphic?
164
+ options[:foreign_key] = true
165
+ end
162
166
  end
163
167
  end
164
168
  end
@@ -340,7 +340,7 @@ module Rails
340
340
  #
341
341
  # This class should be called before the AppGenerator is required and started
342
342
  # since it configures and mutates ARGV correctly.
343
- class ARGVScrubber # :nodoc
343
+ class ARGVScrubber # :nodoc:
344
344
  def initialize(argv = ARGV)
345
345
  @argv = argv
346
346
  end
@@ -3,6 +3,7 @@ require File.expand_path('../boot', __FILE__)
3
3
  <% if include_all_railties? -%>
4
4
  require 'rails/all'
5
5
  <% else -%>
6
+ require "rails"
6
7
  # Pick the frameworks you want:
7
8
  require "active_model/railtie"
8
9
  require "active_job/railtie"
@@ -22,7 +22,7 @@ Description:
22
22
 
23
23
  If you pass a namespaced model name (e.g. admin/account or Admin::Account)
24
24
  then the generator will create a module with a table_name_prefix method
25
- to prefix the model's table name with the module name (e.g. admin_account)
25
+ to prefix the model's table name with the module name (e.g. admin_accounts)
26
26
 
27
27
  Available field types:
28
28
 
@@ -45,3 +45,7 @@ end
45
45
  # gem 'byebug', group: [:development, :test]
46
46
  <%- end -%>
47
47
  <% end -%>
48
+
49
+ <% if RUBY_PLATFORM.match(/bccwin|cygwin|emx|mingw|mswin|wince|java/) -%>
50
+ gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
51
+ <% end -%>
@@ -20,4 +20,5 @@ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
20
20
  # Load fixtures from the engine
21
21
  if ActiveSupport::TestCase.respond_to?(:fixture_path=)
22
22
  ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
23
+ ActiveSupport::TestCase.fixtures :all
23
24
  end
@@ -7,6 +7,7 @@ module Rails
7
7
 
8
8
  check_class_collision suffix: "Controller"
9
9
 
10
+ class_option :helper, type: :boolean
10
11
  class_option :orm, banner: "NAME", type: :string, required: true,
11
12
  desc: "ORM to generate the controller for"
12
13
 
@@ -93,7 +93,7 @@ module Rails
93
93
  # end
94
94
  # end
95
95
  #
96
- # By default, Rails load generators from your load path. However, if you want to place
96
+ # By default, Rails loads generators from your load path. However, if you want to place
97
97
  # your generators at a different location, you can specify in your Railtie a block which
98
98
  # will load them during normal generators lookup:
99
99
  #
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railties
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.0
4
+ version: 4.2.1.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-20 00:00:00.000000000 Z
11
+ date: 2015-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 4.2.0
19
+ version: 4.2.1.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.2.0
26
+ version: 4.2.1.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.2.0
33
+ version: 4.2.1.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.2.0
40
+ version: 4.2.1.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.2.0
81
+ version: 4.2.1.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.2.0
88
+ version: 4.2.1.rc1
89
89
  description: 'Rails internals: application bootup, plugins, generators, and rake tasks.'
90
90
  email: david@loudthinking.com
91
91
  executables:
@@ -352,12 +352,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
352
352
  version: 1.9.3
353
353
  required_rubygems_version: !ruby/object:Gem::Requirement
354
354
  requirements:
355
- - - ">="
355
+ - - ">"
356
356
  - !ruby/object:Gem::Version
357
- version: '0'
357
+ version: 1.3.1
358
358
  requirements: []
359
359
  rubyforge_project:
360
- rubygems_version: 2.2.2
360
+ rubygems_version: 2.4.5
361
361
  signing_key:
362
362
  specification_version: 4
363
363
  summary: Tools for creating, working with, and running Rails applications.