Merge branch 'master' of github.com:rails/docrails

Conflicts:
	actionview/README.rdoc
	activerecord/lib/active_record/migration.rb
	guides/source/development_dependencies_install.md
	guides/source/getting_started.md
This commit is contained in:
Vijay Dev 2013-08-17 21:49:16 +05:30
commit 9abe72c760
35 changed files with 131 additions and 88 deletions

View File

@ -64,7 +64,7 @@ module ActionMailer
raise "Delivery method cannot be nil"
when Symbol
if klass = delivery_methods[method]
mail.delivery_method(klass, (send(:"#{method}_settings") || {}).merge(options || {}))
mail.delivery_method(klass,(send(:"#{method}_settings") || {}).merge!(options || {}))
else
raise "Invalid delivery method #{method.inspect}"
end

View File

@ -152,9 +152,6 @@ class MailDeliveryTest < ActiveSupport::TestCase
assert_equal "overridden", delivery_method_instance.settings[:user_name]
assert_equal "somethingobtuse", delivery_method_instance.settings[:password]
assert_equal delivery_method_instance.settings.merge(overridden_options), delivery_method_instance.settings
# make sure that overriding delivery method options per mail instance doesn't affect the Base setting
assert_equal settings, ActionMailer::Base.smtp_settings
end
test "non registered delivery methods raises errors" do

View File

@ -59,7 +59,7 @@ module ActionController
# <input type="text" name="post[address]" value="hyacintvej">
#
# A request stemming from a form holding these inputs will include <tt>{ "post" => { "name" => "david", "address" => "hyacintvej" } }</tt>.
# If the address input had been named <tt>post[address][street]</tt>, the params would have included
# If the address input had been named "post[address][street]", the params would have included
# <tt>{ "post" => { "address" => { "street" => "hyacintvej" } } }</tt>. There's no limit to the depth of the nesting.
#
# == Sessions

View File

@ -514,12 +514,11 @@ module ActionDispatch
@recall = recall.dup
@set = set
normalize_recall!
normalize_options!
normalize_controller_action_id!
use_relative_controller!
normalize_controller!
normalize_action!
handle_nil_action!
end
def controller
@ -538,11 +537,6 @@ module ActionDispatch
end
end
# Set 'index' as default action for recall
def normalize_recall!
@recall[:action] ||= 'index'
end
def normalize_options!
# If an explicit :controller was given, always make :action explicit
# too, so that action expiry works as expected for things like
@ -558,8 +552,8 @@ module ActionDispatch
options[:controller] = options[:controller].to_s
end
if options.key?(:action)
options[:action] = (options[:action] || 'index').to_s
if options[:action]
options[:action] = options[:action].to_s
end
end
@ -569,6 +563,8 @@ module ActionDispatch
# :controller, :action or :id is not found, don't pull any
# more keys from the recall.
def normalize_controller_action_id!
@recall[:action] ||= 'index' if current_controller
use_recall_for(:controller) or return
use_recall_for(:action) or return
use_recall_for(:id)
@ -590,11 +586,13 @@ module ActionDispatch
@options[:controller] = controller.sub(%r{^/}, '') if controller
end
# Move 'index' action from options to recall
def normalize_action!
if @options[:action] == 'index'
@recall[:action] = @options.delete(:action)
# This handles the case of action: nil being explicitly passed.
# It is identical to action: "index"
def handle_nil_action!
if options.has_key?(:action) && options[:action].nil?
options[:action] = 'index'
end
recall[:action] = options.delete(:action) if options[:action] == 'index'
end
# Generates a path from routes, returns [path, params].

View File

@ -646,7 +646,6 @@ class RespondWithControllerTest < ActionController::TestCase
Mime::Type.register_alias('text/html', :iphone)
Mime::Type.register_alias('text/html', :touch)
Mime::Type.register('text/x-mobile', :mobile)
Customer.send(:undef_method, :to_json) if Customer.method_defined?(:to_json)
end
def teardown

View File

@ -92,7 +92,7 @@ module RenderStreaming
io.rewind
assert_match "(undefined method `invalid!' for nil:NilClass)", io.read
ensure
ActionView::Base.logger = _old
ActionController::Base.logger = _old
end
end

View File

@ -775,10 +775,6 @@ class RenderTest < ActionController::TestCase
@request.host = "www.nextangle.com"
end
def teardown
ActionView::Base.logger = nil
end
# :ported:
def test_simple_show
get :hello_world

View File

@ -5,7 +5,7 @@ Gem::Specification.new do |s|
s.name = 'actionview'
s.version = version
s.summary = 'Rendering framework putting the V in MVC (part of Rails).'
s.description = 'Simple, battle-tested conventions and helpers for building web pages.'
s.description = ''
s.required_ruby_version = '>= 1.9.3'

View File

@ -654,7 +654,7 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase
sarah = Person.create!(:first_name => 'Sarah', :primary_contact_id => people(:susan).id, :gender => 'F', :number1_fan_id => 1)
john = Person.create!(:first_name => 'John', :primary_contact_id => sarah.id, :gender => 'M', :number1_fan_id => 1)
assert_equal sarah.agents, [john]
assert_equal people(:susan).agents.flat_map(&:agents), people(:susan).agents_of_agents
assert_equal people(:susan).agents.map(&:agents).flatten, people(:susan).agents_of_agents
end
def test_associate_existing_with_nonstandard_primary_key_on_belongs_to

View File

@ -453,11 +453,6 @@ class TransactionTest < ActiveRecord::TestCase
raise ActiveRecord::Rollback
end
end
ensure
Topic.reset_column_information # reset the column information to get correct reading
Topic.connection.remove_column('topics', 'stuff') if Topic.column_names.include?('stuff')
Topic.reset_column_information # reset the column information again for other tests
end
def test_transactions_state_from_rollback

View File

@ -8,7 +8,9 @@ class Author < ActiveRecord::Base
has_many :posts_sorted_by_id_limited, -> { order('posts.id').limit(1) }, :class_name => "Post"
has_many :posts_with_categories, -> { includes(:categories) }, :class_name => "Post"
has_many :posts_with_comments_and_categories, -> { includes(:comments, :categories).order("posts.id") }, :class_name => "Post"
has_many :posts_containing_the_letter_a, :class_name => "Post"
has_many :posts_with_special_categorizations, :class_name => 'PostWithSpecialCategorization'
has_many :posts_with_extension, :class_name => "Post"
has_one :post_about_thinking, -> { where("posts.title like '%thinking%'") }, :class_name => 'Post'
has_one :post_about_thinking_with_last_comment, -> { where("posts.title like '%thinking%'").includes(:last_comment) }, :class_name => 'Post'
has_many :comments, through: :posts do
@ -30,6 +32,7 @@ class Author < ActiveRecord::Base
has_many :welcome_posts, -> { where(:title => 'Welcome to the weblog') }, :class_name => 'Post'
has_many :comments_desc, -> { order('comments.id DESC') }, :through => :posts, :source => :comments
has_many :limited_comments, -> { limit(1) }, :through => :posts, :source => :comments
has_many :funky_comments, :through => :posts, :source => :comments
has_many :ordered_uniq_comments, -> { distinct.order('comments.id') }, :through => :posts, :source => :comments
has_many :ordered_uniq_comments_desc, -> { distinct.order('comments.id DESC') }, :through => :posts, :source => :comments

View File

@ -1,4 +1,4 @@
class AutoId < ActiveRecord::Base
self.table_name = "auto_id_tests"
self.primary_key = "auto_id"
def self.table_name () "auto_id_tests" end
def self.primary_key () "auto_id" end
end

View File

@ -1,9 +1,12 @@
class Car < ActiveRecord::Base
has_many :bulbs
has_many :funky_bulbs, class_name: 'FunkyBulb', dependent: :destroy
has_many :foo_bulbs, -> { where(:name => 'foo') }, :class_name => "Bulb"
has_many :frickinawesome_bulbs, -> { where :frickinawesome => true }, :class_name => "Bulb"
has_one :bulb
has_one :frickinawesome_bulb, -> { where :frickinawesome => true }, :class_name => "Bulb"
has_many :tyres
has_many :engines, :dependent => :destroy

View File

@ -1,3 +1,6 @@
class Citation < ActiveRecord::Base
belongs_to :reference_of, :class_name => "Book", :foreign_key => :book2_id
belongs_to :book1, :class_name => "Book", :foreign_key => :book1_id
belongs_to :book2, :class_name => "Book", :foreign_key => :book2_id
end

View File

@ -2,6 +2,7 @@ class Club < ActiveRecord::Base
has_one :membership
has_many :memberships, :inverse_of => false
has_many :members, :through => :memberships
has_many :current_memberships
has_one :sponsor
has_one :sponsored_member, :through => :sponsor, :source => :sponsorable, :source_type => "Member"
belongs_to :category

View File

@ -49,6 +49,7 @@ class Firm < Company
has_many :clients_like_ms, -> { where("name = 'Microsoft'").order("id") }, :class_name => "Client"
has_many :clients_like_ms_with_hash_conditions, -> { where(:name => 'Microsoft').order("id") }, :class_name => "Client"
has_many :plain_clients, :class_name => 'Client'
has_many :readonly_clients, -> { readonly }, :class_name => 'Client'
has_many :clients_using_primary_key, :class_name => 'Client',
:primary_key => 'name', :foreign_key => 'firm_name'
has_many :clients_using_primary_key_with_delete_all, :class_name => 'Client',
@ -166,6 +167,7 @@ class ExclusivelyDependentFirm < Company
has_one :account, :foreign_key => "firm_id", :dependent => :delete
has_many :dependent_sanitized_conditional_clients_of_firm, -> { order("id").where("name = 'BigShot Inc.'") }, :foreign_key => "client_of", :class_name => "Client", :dependent => :delete_all
has_many :dependent_conditional_clients_of_firm, -> { order("id").where("name = ?", 'BigShot Inc.') }, :foreign_key => "client_of", :class_name => "Client", :dependent => :delete_all
has_many :dependent_hash_conditional_clients_of_firm, -> { order("id").where(:name => 'BigShot Inc.') }, :foreign_key => "client_of", :class_name => "Client", :dependent => :delete_all
end
class SpecialClient < Client

View File

@ -2,6 +2,7 @@ class Member < ActiveRecord::Base
has_one :current_membership
has_one :selected_membership
has_one :membership
has_many :fellow_members, :through => :club, :source => :members
has_one :club, :through => :current_membership
has_one :selected_club, :through => :selected_membership, :source => :club
has_one :favourite_club, -> { where "memberships.favourite = ?", true }, :through => :membership, :source => :club

View File

@ -1,3 +1,5 @@
class Movie < ActiveRecord::Base
self.primary_key = "movieid"
def self.primary_key
"movieid"
end
end

View File

@ -122,6 +122,7 @@ class Post < ActiveRecord::Base
has_many :secure_readers
has_many :readers_with_person, -> { includes(:person) }, :class_name => "Reader"
has_many :people, :through => :readers
has_many :secure_people, :through => :secure_readers
has_many :single_people, :through => :readers
has_many :people_with_callbacks, :source=>:person, :through => :readers,
:before_add => lambda {|owner, reader| log(:added, :before, reader.first_name) },

View File

@ -1,6 +1,7 @@
class Project < ActiveRecord::Base
has_and_belongs_to_many :developers, -> { distinct.order 'developers.name desc, developers.id desc' }
has_and_belongs_to_many :readonly_developers, -> { readonly }, :class_name => "Developer"
has_and_belongs_to_many :selected_developers, -> { distinct.select "developers.*" }, :class_name => "Developer"
has_and_belongs_to_many :non_unique_developers, -> { order 'developers.name desc, developers.id desc' }, :class_name => 'Developer'
has_and_belongs_to_many :limited_developers, -> { limit 1 }, :class_name => "Developer"
has_and_belongs_to_many :developers_named_david, -> { where("name = 'David'").distinct }, :class_name => "Developer"

View File

@ -34,6 +34,7 @@ class Topic < ActiveRecord::Base
has_many :replies, :dependent => :destroy, :foreign_key => "parent_id"
has_many :approved_replies, -> { approved }, class_name: 'Reply', foreign_key: "parent_id", counter_cache: 'replies_count'
has_many :replies_with_primary_key, :class_name => "Reply", :dependent => :destroy, :primary_key => "title", :foreign_key => "parent_title"
has_many :unique_replies, :dependent => :destroy, :foreign_key => "parent_id"
has_many :silly_unique_replies, :dependent => :destroy, :foreign_key => "parent_id"

View File

@ -129,7 +129,7 @@ class Date
options.fetch(:day, day)
)
end
# Allow Date to be compared with Time by converting to DateTime and relying on the <=> from there.
def compare_with_coercion(other)
if other.is_a?(Time)

View File

@ -235,6 +235,7 @@ module ActiveSupport
value.map! { |i| deep_to_h(i) }
value.length > 1 ? value : value.first
end
end
end

View File

@ -47,7 +47,7 @@ class Object
end
# Same as #try, but will raise a NoMethodError exception if the receiving is not nil and
# does not implement the tried method.
# does not implemented the tried method.
def try!(*a, &b)
if a.empty? && block_given?
yield self

View File

@ -3,6 +3,7 @@ require 'abstract_unit'
require 'active_support/inflector/transliterate'
class TransliterateTest < ActiveSupport::TestCase
def test_transliterate_should_not_change_ascii_chars
(0..127).each do |byte|
char = [byte].pack("U")
@ -23,13 +24,12 @@ class TransliterateTest < ActiveSupport::TestCase
def test_transliterate_should_work_with_custom_i18n_rules_and_uncomposed_utf8
char = [117, 776].pack("U*") # "ü" as ASCII "u" plus COMBINING DIAERESIS
I18n.backend.store_translations(:de, :i18n => {:transliterate => {:rule => {"ü" => "ue"}}})
default_locale, I18n.locale = I18n.locale, :de
I18n.locale = :de
assert_equal "ue", ActiveSupport::Inflector.transliterate(char)
ensure
I18n.locale = default_locale
end
def test_transliterate_should_allow_a_custom_replacement_char
assert_equal "a*b", ActiveSupport::Inflector.transliterate("a索b", "*")
end
end

View File

@ -106,11 +106,7 @@ module XmlMiniTest
module Nokogiri end
setup do
@xml, @default_backend = ActiveSupport::XmlMini, ActiveSupport::XmlMini.backend
end
teardown do
ActiveSupport::XmlMini.backend = @default_backend
@xml = ActiveSupport::XmlMini
end
test "#with_backend should switch backend and then switch back" do
@ -139,11 +135,7 @@ module XmlMiniTest
module LibXML end
setup do
@xml, @default_backend = ActiveSupport::XmlMini, ActiveSupport::XmlMini.backend
end
teardown do
ActiveSupport::XmlMini.backend = @default_backend
@xml = ActiveSupport::XmlMini
end
test "#with_backend should be thread-safe" do

View File

@ -15,7 +15,7 @@
</p>
<% end %>
<p>
The guides for Rails 3.2.x are available at <a href="http://guides.rubyonrails.org/v3.2.14/">http://guides.rubyonrails.org/v3.2.14/</a>.
The guides for Rails 3.2.x are available at <a href="http://guides.rubyonrails.org/v3.2.13/">http://guides.rubyonrails.org/v3.2.13/</a>.
</p>
<p>
The guides for Rails 2.3.x are available at <a href="http://guides.rubyonrails.org/v2.3.11/">http://guides.rubyonrails.org/v2.3.11/</a>.

View File

@ -514,13 +514,7 @@ SELECT * FROM clients WHERE (clients.orders_count IN (1,3,5))
Post.where.not(author: author)
```
In other words, this query can be generated by calling `where` with no argument,
then immediately chain with `not` passing `where` conditions. This will generate
SQL code like this:
```sql
SELECT * FROM posts WHERE (author_id != 1)
```
In other words, this query can be generated by calling `where` with no argument, then immediately chain with `not` passing `where` conditions.
Ordering
--------

View File

@ -96,13 +96,12 @@ INFO: The predicate for strings uses the Unicode-aware character class `[:space:
WARNING: Note that numbers are not mentioned. In particular, 0 and 0.0 are **not** blank.
For example, this method from `ActionController::HttpAuthentication::Token::ControllerMethods` uses `blank?` for checking whether a token is present:
For example, this method from `ActionDispatch::Session::AbstractStore` uses `blank?` for checking whether a session key is present:
```ruby
def authenticate(controller, &login_procedure)
token, options = token_and_options(controller.request)
unless token.blank?
login_procedure.call(token, options)
def ensure_session_key!
if @key.blank?
raise ArgumentError, 'A key is required...'
end
end
```
@ -421,9 +420,9 @@ NOTE: Defined in `active_support/core_ext/object/with_options.rb`.
### JSON support
Active Support provides a better implemention of `to_json` than the `json` gem ordinarily provides for Ruby objects. This is because some classes, like `Hash` and `OrderedHash` needs special handling in order to provide a proper JSON representation.
Active Support provides a better implemention of `to_json` than the +json+ gem ordinarily provides for Ruby objects. This is because some classes, like +Hash+ and +OrderedHash+ needs special handling in order to provide a proper JSON representation.
Active Support also provides an implementation of `as_json` for the `Process::Status` class.
Active Support also provides an implementation of `as_json` for the <tt>Process::Status</tt> class.
NOTE: Defined in `active_support/core_ext/object/to_json.rb`.
@ -1249,6 +1248,18 @@ Calling `to_s` on a safe string returns a safe string, but coercion with `to_str
Calling `dup` or `clone` on safe strings yields safe strings.
### `remove`
The method `remove` will remove all occurrences of the pattern:
```ruby
"Hello World".remove(/Hello /) => "World"
```
There's also the destructive version `String#remove!`.
NOTE: Defined in `active_support/core_ext/string/filters.rb`.
### `squish`
The method `squish` strips leading and trailing whitespace, and substitutes runs of whitespace with a single space each:
@ -1988,7 +1999,7 @@ Produce a string representation of a number in human-readable words:
1234567890123456.to_s(:human) # => "1.23 Quadrillion"
```
NOTE: Defined in `active_support/core_ext/numeric/conversions.rb`.
NOTE: Defined in `active_support/core_ext/numeric/formatting.rb`.
Extensions to `Integer`
-----------------------
@ -2046,7 +2057,7 @@ BigDecimal.new(5.00, 6).to_s # => "5.0"
### `to_formatted_s`
The method `to_formatted_s` provides a default specifier of "F". This means that a simple call to `to_formatted_s` or `to_s` will result in floating point representation instead of engineering notation:
Te method `to_formatted_s` provides a default specifier of "F". This means that a simple call to `to_formatted_s` or `to_s` will result in floating point representation instead of engineering notation:
```ruby
BigDecimal.new(5.00, 6).to_formatted_s # => "5.0"
@ -2433,7 +2444,7 @@ dup[1][2] = 4
array[1][2] == nil # => true
```
NOTE: Defined in `active_support/core_ext/object/deep_dup.rb`.
NOTE: Defined in `active_support/core_ext/array/deep_dup.rb`.
### Grouping
@ -2659,7 +2670,45 @@ hash[:b][:e] == nil # => true
hash[:b][:d] == [3, 4] # => true
```
NOTE: Defined in `active_support/core_ext/object/deep_dup.rb`.
NOTE: Defined in `active_support/core_ext/hash/deep_dup.rb`.
### Diffing
The method `diff` returns a hash that represents a diff of the receiver and the argument with the following logic:
* Pairs `key`, `value` that exist in both hashes do not belong to the diff hash.
* If both hashes have `key`, but with different values, the pair in the receiver wins.
* The rest is just merged.
```ruby
{a: 1}.diff(a: 1)
# => {}, first rule
{a: 1}.diff(a: 2)
# => {:a=>1}, second rule
{a: 1}.diff(b: 2)
# => {:a=>1, :b=>2}, third rule
{a: 1, b: 2, c: 3}.diff(b: 1, c: 3, d: 4)
# => {:a=>1, :b=>2, :d=>4}, all rules
{}.diff({}) # => {}
{a: 1}.diff({}) # => {:a=>1}
{}.diff(a: 1) # => {:a=>1}
```
An important property of this diff hash is that you can retrieve the original hash by applying `diff` twice:
```ruby
hash.diff(hash2).diff(hash2) == hash
```
Diffing hashes may be useful for error messages related to expected option hashes for example.
NOTE: Defined in `active_support/core_ext/hash/diff.rb`.
### Working with Keys
@ -3794,13 +3843,13 @@ def default_helper_module!
module_path = module_name.underscore
helper module_path
rescue MissingSourceFile => e
raise e unless e.is_missing? "helpers/#{module_path}_helper"
raise e unless e.is_missing? "#{module_path}_helper"
rescue NameError => e
raise e unless e.missing_name? "#{module_name}Helper"
end
```
NOTE: Defined in `actionpack/lib/abstract_controller/helpers.rb`.
NOTE: Defined in `active_support/core_ext/name_error.rb`.
Extensions to `LoadError`
-------------------------
@ -3823,4 +3872,4 @@ rescue NameError => e
end
```
NOTE: Defined in `actionpack/lib/abstract_controller/helpers.rb`.
NOTE: Defined in `active_support/core_ext/load_error.rb`.

View File

@ -74,7 +74,7 @@ ports.
If you have any problems with these libraries, you can install them manually by compiling the source code. Just follow the instructions at the [Red Hat/CentOS section of the Nokogiri tutorials](http://nokogiri.org/tutorials/installing_nokogiri.html#red_hat__centos) .
Also, SQLite3 and its development files for the `sqlite3` gem — in Ubuntu you're done with just
Also, SQLite3 and its development files for the `sqlite3-ruby` gem — in Ubuntu you're done with just
```bash
$ sudo apt-get install sqlite3 libsqlite3-dev
@ -86,6 +86,7 @@ And if you are on Fedora or CentOS, you're done with
$ sudo yum install sqlite3 sqlite3-devel
```
<<<<<<< HEAD
If you are on Arch Linux, you will need to run:
```bash
@ -100,6 +101,8 @@ For FreeBSD users, you're done with:
Or compile the `databases/sqlite3` port.
=======
>>>>>>> ec8ef1e1055c4e1598da13f49d30261f07f4a9b4
Get a recent version of [Bundler](http://gembundler.com/)
```bash
@ -166,6 +169,7 @@ $ sudo yum install mysql-server mysql-devel
$ sudo yum install postgresql-server postgresql-devel
```
<<<<<<< HEAD
If you are running Arch Linux, MySQL isn't supported anymore so you will need to
use MariaDB instead (see [this announcement](https://www.archlinux.org/news/mariadb-replaces-mysql-in-repositories/)):
@ -185,6 +189,8 @@ Or install them through ports (they are located under the `databases` folder).
If you run into troubles during the installation of MySQL, please see
[the MySQL documentation](http://dev.mysql.com/doc/refman/5.1/en/freebsd-installation.html).
=======
>>>>>>> ec8ef1e1055c4e1598da13f49d30261f07f4a9b4
After that, run:
```bash

View File

@ -598,8 +598,9 @@ end
```
A couple of things to note. We use `Post.find` to find the post we're
interested in. We also use an instance variable (prefixed by `@`) to
hold a reference to the post object. We do this because Rails will pass all instance
interested in, passing in `params[:id]` to get the `:id` parameter from the
request. We also use an instance variable (prefixed by `@`) to hold a
reference to the post object. We do this because Rails will pass all instance
variables to the view.
Now, create a new file `app/views/posts/show.html.erb` with the following

View File

@ -320,7 +320,7 @@ config.assets.js_compressor = :uglifier
### sass-rails
* `asset-url` with two arguments is deprecated. For example: `asset-url("rails.png", image)` becomes `asset-url("rails.png")`
* `asset_url` with two arguments is deprecated. For example: `asset-url("rails.png", image)` becomes `asset-url("rails.png")`
Upgrading from Rails 3.1 to Rails 3.2
-------------------------------------

View File

@ -16,7 +16,8 @@ module Rails
:include => %w(
README.rdoc
lib/active_record/**/*.rb
)
),
:exclude => 'lib/active_record/vendor/*'
},
'activemodel' => {
@ -32,22 +33,23 @@ module Rails
lib/abstract_controller/**/*.rb
lib/action_controller/**/*.rb
lib/action_dispatch/**/*.rb
)
),
:exclude => 'lib/action_controller/vendor/*'
},
'actionview' => {
:include => %w(
README.rdoc
lib/action_view/**/*.rb
),
:exclude => 'lib/action_view/vendor/*'
)
},
'actionmailer' => {
:include => %w(
README.rdoc
lib/action_mailer/**/*.rb
)
),
:exclude => 'lib/action_mailer/vendor/*'
},
'railties' => {

View File

@ -2,7 +2,7 @@ require 'pathname'
module Rails
module AppRailsLoader
RUBY = Gem.ruby
RUBY = File.join(*RbConfig::CONFIG.values_at("bindir", "ruby_install_name")) + RbConfig::CONFIG["EXEEXT"]
EXECUTABLES = ['bin/rails', 'script/rails']
BUNDLER_WARNING = <<EOS
Looks like your app's ./bin/rails is a stub that was generated by Bundler.

View File

@ -351,13 +351,8 @@ module Rails
Rails::Railtie::Configuration.eager_load_namespaces << base
base.called_from = begin
call_stack = if Kernel.respond_to?(:caller_locations)
caller_locations.map(&:path)
else
# Remove the line number from backtraces making sure we don't leave anything behind
caller.map { |p| p.sub(/:\d+.*/, '') }
end
# Remove the line number from backtraces making sure we don't leave anything behind
call_stack = caller.map { |p| p.sub(/:\d+.*/, '') }
File.dirname(call_stack.detect { |p| p !~ %r[railties[\w.-]*/lib/rails|rack[\w.-]*/lib/rack] })
end
end