rails--rails/guides
Takehiro Adachi 740f7787e0 Fix active_record_validations.md document, `:save` for `on:` validation helper was never available
According to the guide, ":save" value for the "on:" validation helper
was available like below

    validates :name, presence: true, on: :save

but this was never available according to the implementation of the
valid? method, which is below

    # Runs all the validations within the specified context. Returns
+true+ if
    # no errors are found, +false+ otherwise.
    #
    # If the argument is +false+ (default is +nil+), the context is set
to <tt>:create</tt> if
    # <tt>new_record?</tt> is +true+, and to <tt>:update</tt> if it is
not.
    #
    # Validations with no <tt>:on</tt> option will run no matter the
context. Validations with
    # some <tt>:on</tt> option will only run in the specified context.
    def valid?(context = nil)
      context ||= (new_record? ? :create : :update)
      output = super(context)
      errors.empty? && output
    end

So the documentation was always wrong since the PR proposed by
@neerajdotname  ( #10287 ) was rejected.
2013-08-04 18:37:12 +09:00
..
assets Merge pull request #11073 from tricknotes/improve-guides-js 2013-07-09 02:47:04 -07:00
bug_report_templates Use activerecord 4.0.0 for reporting bugs using the template[ci skip] 2013-06-27 12:26:58 +05:30
code/getting_started bcrypt-ruby stable is 3.1 2013-07-17 16:39:07 +02:00
rails_guides remove unused variable 2013-04-13 13:19:54 +05:30
source Fix active_record_validations.md document, `:save` for `on:` validation helper was never available 2013-08-04 18:37:12 +09:00
.document adds guides/.document to tell rdoc not to process this directory 2013-03-04 22:28:23 +01:00
CHANGELOG.md cleanup, remove trailing whitespace from guides/CHANGELOG 2013-07-03 21:47:08 +02:00
Rakefile Revert "Whitespace trimming in guides generation" 2013-06-14 00:30:40 +05:30
rails_guides.rb Make `rake doc:guides` works again. Fix #10384. 2013-04-30 06:49:03 -07:00
w3c_validator.rb