Skip to content
This repository
Browse code

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

  • Loading branch information...
commit 88daf082581bcec5fcdbb92d1fd784188e4d99bd 2 parents 5b2eb64 + e3bc138
Vijay Dev vijaydev authored
10 actionpack/lib/action_dispatch/http/request.rb
@@ -94,31 +94,31 @@ def method_symbol
94 94 end
95 95
96 96 # Is this a GET (or HEAD) request?
97   - # Equivalent to <tt>request.request_method == :get</tt>.
  97 + # Equivalent to <tt>request.request_method_symbol == :get</tt>.
98 98 def get?
99 99 HTTP_METHOD_LOOKUP[request_method] == :get
100 100 end
101 101
102 102 # Is this a POST request?
103   - # Equivalent to <tt>request.request_method == :post</tt>.
  103 + # Equivalent to <tt>request.request_method_symbol == :post</tt>.
104 104 def post?
105 105 HTTP_METHOD_LOOKUP[request_method] == :post
106 106 end
107 107
108 108 # Is this a PUT request?
109   - # Equivalent to <tt>request.request_method == :put</tt>.
  109 + # Equivalent to <tt>request.request_method_symbol == :put</tt>.
110 110 def put?
111 111 HTTP_METHOD_LOOKUP[request_method] == :put
112 112 end
113 113
114 114 # Is this a DELETE request?
115   - # Equivalent to <tt>request.request_method == :delete</tt>.
  115 + # Equivalent to <tt>request.request_method_symbol == :delete</tt>.
116 116 def delete?
117 117 HTTP_METHOD_LOOKUP[request_method] == :delete
118 118 end
119 119
120 120 # Is this a HEAD request?
121   - # Equivalent to <tt>request.method == :head</tt>.
  121 + # Equivalent to <tt>request.method_symbol == :head</tt>.
122 122 def head?
123 123 HTTP_METHOD_LOOKUP[method] == :head
124 124 end
4 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -1046,8 +1046,8 @@ def resource(*resources, &block)
1046 1046 # Takes same options as <tt>Base#match</tt> as well as:
1047 1047 #
1048 1048 # [:path_names]
1049   - # Allows you to change the paths of the seven default actions.
1050   - # Paths not specified are not changed.
  1049 + # Allows you to change the segment component of the +edit+ and +new+ actions.
  1050 + # Actions not specified are not changed.
1051 1051 #
1052 1052 # resources :posts, :path_names => { :new => "brand_new" }
1053 1053 #
6 activemodel/lib/active_model/validations/presence.rb
@@ -25,14 +25,14 @@ module HelperMethods
25 25 # This is due to the way Object#blank? handles boolean values: <tt>false.blank? # => true</tt>.
26 26 #
27 27 # Configuration options:
28   - # * <tt>message</tt> - A custom error message (default is: "can't be blank").
  28 + # * <tt>:message</tt> - A custom error message (default is: "can't be blank").
29 29 # * <tt>:on</tt> - Specifies when this validation is active. Runs in all
30 30 # validation contexts by default (+nil+), other options are <tt>:create</tt>
31 31 # and <tt>:update</tt>.
32   - # * <tt>if</tt> - Specifies a method, proc or string to call to determine if the validation should
  32 + # * <tt>:if</tt> - Specifies a method, proc or string to call to determine if the validation should
33 33 # occur (e.g. <tt>:if => :allow_validation</tt>, or <tt>:if => Proc.new { |user| user.signup_step > 2 }</tt>).
34 34 # The method, proc or string should return or evaluate to a true or false value.
35   - # * <tt>unless</tt> - Specifies a method, proc or string to call to determine if the validation should
  35 + # * <tt>:unless</tt> - Specifies a method, proc or string to call to determine if the validation should
36 36 # not occur (e.g. <tt>:unless => :skip_validation</tt>, or <tt>:unless => Proc.new { |user| user.signup_step <= 2 }</tt>).
37 37 # The method, proc or string should return or evaluate to a true or false value.
38 38 # * <tt>:strict</tt> - Specifies whether validation should be strict.
2  activemodel/lib/active_model/validations/with.rb
@@ -56,7 +56,7 @@ module ClassMethods
56 56 # if the validation should occur (e.g. <tt>:if => :allow_validation</tt>,
57 57 # or <tt>:if => Proc.new { |user| user.signup_step > 2 }</tt>).
58 58 # The method, proc or string should return or evaluate to a true or false value.
59   - # * <tt>unless</tt> - Specifies a method, proc or string to call to
  59 + # * <tt>:unless</tt> - Specifies a method, proc or string to call to
60 60 # determine if the validation should not occur
61 61 # (e.g. <tt>:unless => :skip_validation</tt>, or
62 62 # <tt>:unless => Proc.new { |user| user.signup_step <= 2 }</tt>).
4 railties/guides/source/active_support_core_extensions.textile
Source Rendered
@@ -440,14 +440,16 @@ NOTE: Defined in +active_support/core_ext/kernel/reporting.rb+.
440 440
441 441 h4. +in?+
442 442
443   -The predicate +in?+ tests if an object is included in another object. An +ArgumentError+ exception will be raised if the argument passed does not respond to +include?+.
  443 +The predicate +in?+ tests if an object is included in another object or a list of objects. An +ArgumentError+ exception will be raised if a single argument is passed and it does not respond to +include?+.
444 444
445 445 Examples of +in?+:
446 446
447 447 <ruby>
  448 +1.in?(1,2) # => true
448 449 1.in?([1,2]) # => true
449 450 "lo".in?("hello") # => true
450 451 25.in?(30..50) # => false
  452 +1.in?(1) # => ArgumentError
451 453 </ruby>
452 454
453 455 NOTE: Defined in +active_support/core_ext/object/inclusion.rb+.
2  railties/guides/source/command_line.textile
Source Rendered
@@ -81,6 +81,8 @@ The server can be run on a different port using the +-p+ option. The default dev
81 81 $ rails server -e production -p 4000
82 82 </shell>
83 83
  84 +The +-b+ option binds Rails to the specified ip, by default it is 0.0.0.0. You can run a server as a daemon by passing a +-d+ option.
  85 +
84 86 h4. +rails generate+
85 87
86 88 The +rails generate+ command uses templates to create a whole lot of things. Running +rails generate+ by itself gives a list of available generators:
3  railties/guides/source/configuring.textile
Source Rendered
@@ -88,6 +88,8 @@ NOTE. The +config.asset_path+ configuration is ignored if the asset pipeline is
88 88
89 89 * +config.log_level+ defines the verbosity of the Rails logger. This option defaults to +:debug+ for all modes except production, where it defaults to +:info+.
90 90
  91 +* +config.log_tags+ accepts a list of methods that respond to +request+ object. This makes it easy to tag log lines with debug information like subdomain and request id -- both very helpful in debugging multi-user production applications.
  92 +
91 93 * +config.logger+ accepts a logger conforming to the interface of Log4r or the default Ruby +Logger+ class. Defaults to an instance of +ActiveSupport::BufferedLogger+, with auto flushing off in production mode.
92 94
93 95 * +config.middleware+ allows you to configure the application's middleware. This is covered in depth in the "Configuring Middleware":#configuring-middleware section below.
@@ -188,6 +190,7 @@ Every Rails application comes with a standard set of middleware which it uses in
188 190 * +Rack::Runtime+ sets an +X-Runtime+ header, containing the time (in seconds) taken to execute the request.
189 191 * +Rails::Rack::Logger+ notifies the logs that the request has began. After request is complete, flushes all the logs.
190 192 * +ActionDispatch::ShowExceptions+ rescues any exception returned by the application and renders nice exception pages if the request is local or if +config.consider_all_requests_local+ is set to +true+. If +config.action_dispatch.show_exceptions+ is set to +false+, exceptions will be raised regardless.
  193 +* +ActionDispatch::RequestId+ makes a unique X-Request-Id header available to the response and enables the +ActionDispatch::Request#uuid+ method.
191 194 * +ActionDispatch::RemoteIp+ checks for IP spoofing attacks. Configurable with the +config.action_dispatch.ip_spoofing_check+ and +config.action_dispatch.trusted_proxies+ settings.
192 195 * +Rack::Sendfile+ intercepts responses whose body is being served from a file and replaces it with a server specific X-Sendfile header. Configurable with +config.action_dispatch.x_sendfile_header+.
193 196 * +ActionDispatch::Callbacks+ runs the prepare callbacks before serving the request.
2  railties/guides/source/getting_started.textile
Source Rendered
@@ -248,7 +248,7 @@ the following:
248 248 $ rails --version
249 249 </shell>
250 250
251   -If it says something like "Rails 3.1.1" you are ready to continue.
  251 +If it says something like "Rails 3.1.3" you are ready to continue.
252 252
253 253 h4. Creating the Blog Application
254 254
2  railties/guides/source/migrations.textile
Source Rendered
@@ -670,4 +670,4 @@ The Active Record way claims that intelligence belongs in your models, not in th
670 670
671 671 Validations such as +validates :foreign_key, :uniqueness => true+ are one way in which models can enforce data integrity. The +:dependent+ option on associations allows models to automatically destroy child objects when the parent is destroyed. Like anything which operates at the application level, these cannot guarantee referential integrity and so some people augment them with foreign key constraints.
672 672
673   -Although Active Record does not provide any tools for working directly with such features, the +execute+ method can be used to execute arbitrary SQL. There are also a number of plugins such as "foreign_key_migrations":https://github.com/harukizaemon/redhillonrails/tree/master/foreign_key_migrations/ which add foreign key support to Active Record (including support for dumping foreign keys in +db/schema.rb+).
  673 +Although Active Record does not provide any tools for working directly with such features, the +execute+ method can be used to execute arbitrary SQL. You could also use some plugin like "foreigner":https://github.com/matthuhiggins/foreigner which add foreign key support to Active Record (including support for dumping foreign keys in +db/schema.rb+).

0 comments on commit 88daf08

Please sign in to comment.
Something went wrong with that request. Please try again.