Merge branch 'master' of github.com:rails/docrails
Conflicts: guides/source/active_record_validations.md guides/source/api_documentation_guidelines.md guides/source/configuring.md
This commit is contained in:
commit
92fdd65162
|
@ -74,7 +74,7 @@ Or you can just chain the methods together like:
|
|||
|
||||
== Setting defaults
|
||||
|
||||
It is possible to set default values that will be used in every method in your Action Mailer class. To implement this functionality, you just call the public class method <tt>default</tt> which you get for free from <tt>ActionMailer::Base</tt>. This method accepts a Hash as the parameter. You can use any of the headers e-mail messages has, like <tt>:from</tt> as the key. You can also pass in a string as the key, like "Content-Type", but Action Mailer does this out of the box for you, so you won't need to worry about that. Finally, it is also possible to pass in a Proc that will get evaluated when it is needed.
|
||||
It is possible to set default values that will be used in every method in your Action Mailer class. To implement this functionality, you just call the public class method <tt>default</tt> which you get for free from <tt>ActionMailer::Base</tt>. This method accepts a Hash as the parameter. You can use any of the headers email messages have, like <tt>:from</tt> as the key. You can also pass in a string as the key, like "Content-Type", but Action Mailer does this out of the box for you, so you won't need to worry about that. Finally, it is also possible to pass in a Proc that will get evaluated when it is needed.
|
||||
|
||||
Note that every value you set with this method will get overwritten if you use the same key in your mailer method.
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
== Running with Rake
|
||||
|
||||
The easiest way to run the unit tests is through Rake. The default task runs
|
||||
the entire test suite for all classes. For more information, checkout the
|
||||
full array of rake tasks with "rake -T"
|
||||
the entire test suite for all classes. For more information, check out the
|
||||
full array of rake tasks with "rake -T".
|
||||
|
||||
Rake can be found at http://rake.rubyforge.org
|
||||
Rake can be found at http://rake.rubyforge.org.
|
||||
|
||||
== Running by hand
|
||||
|
||||
|
|
|
@ -27,7 +27,8 @@ class Module
|
|||
|
||||
def attr_internal_define(attr_name, type)
|
||||
internal_name = attr_internal_ivar_name(attr_name).sub(/\A@/, '')
|
||||
class_eval do # class_eval is necessary on 1.9 or else the methods a made private
|
||||
# class_eval is necessary on 1.9 or else the methods are made private
|
||||
class_eval do
|
||||
# use native attr_* methods as they are faster on some Ruby implementations
|
||||
send("attr_#{type}", internal_name)
|
||||
end
|
||||
|
|
|
@ -407,7 +407,8 @@ module ActiveSupport #:nodoc:
|
|||
end
|
||||
|
||||
def load_once_path?(path)
|
||||
# to_s works around a ruby1.9 issue where #starts_with?(Pathname) will always return false
|
||||
# to_s works around a ruby1.9 issue where String#starts_with?(Pathname)
|
||||
# will raise a TypeError: no implicit conversion of Pathname into String
|
||||
autoload_once_paths.any? { |base| path.starts_with? base.to_s }
|
||||
end
|
||||
|
||||
|
|
|
@ -577,7 +577,7 @@ so it may happen that two different database connections create two records
|
|||
with the same value for a column that you intend to be unique. To avoid that,
|
||||
you must create a unique index on both columns in your database. See
|
||||
[the MySQL manual](http://dev.mysql.com/doc/refman/5.6/en/multiple-column-indexes.html)
|
||||
for more details about multi column indexes.
|
||||
for more details about multiple column indexes.
|
||||
|
||||
```ruby
|
||||
class Account < ActiveRecord::Base
|
||||
|
|
|
@ -172,7 +172,7 @@ def empty?
|
|||
end
|
||||
```
|
||||
|
||||
The API is careful not to commit to any particular value, the predicate has
|
||||
The API is careful not to commit to any particular value, the method has
|
||||
predicate semantics, that's enough.
|
||||
|
||||
Filenames
|
||||
|
|
|
@ -1145,7 +1145,7 @@ config.assets.digest = true
|
|||
```
|
||||
|
||||
Rails 4 no longer sets default config values for Sprockets in `test.rb`, so
|
||||
`test.rb` now requies Sprockets configuration. The old defaults in the test
|
||||
`test.rb` now requires Sprockets configuration. The old defaults in the test
|
||||
environment are: `config.assets.compile = true`, `config.assets.compress =
|
||||
false`, `config.assets.debug = false` and `config.assets.digest = false`.
|
||||
|
||||
|
|
|
@ -473,7 +473,6 @@ There are a few configuration options available in Active Support:
|
|||
|
||||
* `ActiveSupport::Deprecation.silenced` sets whether or not to display deprecation warnings.
|
||||
|
||||
* `ActiveSupport::Logger.silencer` is set to `false` to disable the ability to silence logging in a block. The default is `true`.
|
||||
|
||||
### Configuring a Database
|
||||
|
||||
|
@ -722,7 +721,7 @@ Rails will now prepend "/app1" when generating links.
|
|||
|
||||
#### Using Passenger
|
||||
|
||||
Passenger makes it easily to run your application in a subdirectory. You can find
|
||||
Passenger makes it easy to run your application in a subdirectory. You can find
|
||||
the relevant configuration in the
|
||||
[passenger manual](http://www.modrails.com/documentation/Users%20guide%20Apache.html#deploying_rails_to_sub_uri).
|
||||
|
||||
|
|
|
@ -136,7 +136,7 @@ You can invoke `test_jdbcmysql`, `test_jdbcsqlite3` or `test_jdbcpostgresql` als
|
|||
|
||||
The test suite runs with warnings enabled. Ideally, Ruby on Rails should issue no warnings, but there may be a few, as well as some from third-party libraries. Please ignore (or fix!) them, if any, and submit patches that do not issue new warnings.
|
||||
|
||||
As of this writing (December, 2010) they are especially noisy with Ruby 1.9. If you are sure about what you are doing and would like to have a more clear output, there's a way to override the flag:
|
||||
If you are sure about what you are doing and would like to have a more clear output, there's a way to override the flag:
|
||||
|
||||
```bash
|
||||
$ RUBYOPT=-W0 bundle exec rake test
|
||||
|
|
Loading…
Reference in New Issue