aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #18835 from jtmkrueger/masterXavier Noria2015-02-071-0/+0
|\ | | | | Use the Rails favicon.ico instead of the ruby favicon.ico for rails guides [ci skip]
| * use rails favicon.ico instead or ruby favicon.ico for rails guidesJohn Krueger2015-02-061-0/+0
| |
* | Merge pull request #14252 from mcfiredrill/make-zones-map-privateArthur Neves2015-02-062-9/+9
|\ \ | | | | | | | | | make zones_map private
| * | make zones_map privateTony Miller2015-02-062-9/+9
|/ / | | | | | | | | Conflicts: activesupport/lib/active_support/values/time_zone.rb
* | Merge pull request #18837 from y-yagi/fix-deprecation-warning-in-render-testArthur Nogueira Neves2015-02-061-2/+2
|\ \ | |/ |/| use kwargs instead of xhr method. refs #18771.
| * use kwargs instead of xhr method. refs #18771.yuuji.yaginuma2015-02-071-2/+2
|/
* Add link to the show action in the getting startedRafael Mendonça França2015-02-061-0/+1
| | | | | | [ci skip] Closes #16538
* Merge pull request #18834 from mfazekas/fix-i18-for-openstructRafael Mendonça França2015-02-062-1/+13
|\ | | | | Fixed undefined method `i18n_key' for nil:NilClass for labels in non AR ...
| * Fixed undefined method `i18n_key' for nil:NilClass for labels in non AR form_forMiklos Fazekas2015-02-062-1/+13
|/ | | | | Refactoring at #18647 broke using non active record objects in form_for. This patch restores the original behaviour where we only compute i18 key when object.respond_to?(:to_model)
* Document the usage of the default option to attributeSean Griffin2015-02-061-0/+14
|
* A symbol can be passed to `attribute`, which should be documentedSean Griffin2015-02-061-3/+4
|
* Grammar and RDoc formattingSean Griffin2015-02-062-35/+37
|
* Remove reference to the now done documentation.rakeXavier Noria2015-02-061-1/+0
|
* README.rdoc -> README.md for newly generated applicationsXavier Noria2015-02-065-5/+9
| | | | | | README.rdoc was generated to support the doc:app task. Now that this task is gone we can switch to Markdown, which is nowadays a better default.
* Remove documentation tasksXavier Noria2015-02-069-121/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the tasks doc:app, doc:rails, and doc:guides. In our experience applications do not generate APIs using doc:app. Methods may be certainly documented for maintainers, annotated with YARD tags, etc. but that is intended to be read with the source code, not in a separate website. Then, teams also have typically selected topics written down in Markdown files, or in a GitHub wiki... that kind of thing. If a team absolutely needs to generate application documentation for internal purposes, they can still easily write their own task. Regarding doc:rails and doc:guides, we live in 2015. We are used to go to online docs all the time. If you really want access to the API offline RubyGems generates it for every Rails component unless you tell it not to, and you can checkout the Rails source code to read the guides as Markdown, or download them for a Kindle reader. All in all, maintaining this code does not seem to be worthwhile anymore. As a consequence of this, guides (+3 MB uncompressed) won't be distributed with the rails gem anymore. Of course, guides and API are going to be still part of releases, since documentation is maintained alongside code and tests. Also, time permitting, this will allow us to experiment with novel ways to generate documentation in the Rails docs server, since right now we were constrained by being able to generate them in the user's environment.
* Docs pass for the attributes APISean Griffin2015-02-062-39/+154
|
* Raise ArgumentError when passing nil to Relation#mergeRafael Mendonça França2015-02-063-1/+24
| | | | | | nil or false should not be valid argument to the merge method. Closes #12264
* Stoping using Relation#merge in default_scopedRafael Mendonça França2015-02-061-1/+7
| | | | | | | | Relation#merge checks if the argument is an array and the only possible returns of build_default_scope is nil or a Relation. Doing this we can raise an ArgumentError when Relation#merge receive a nil value.
* Merge pull request #18833 from perceptec/add_only_performed_optionRafael Mendonça França2015-02-064-18/+186
|\ | | | | Add an `:only` option to `perform_enqueued_jobs` to filter jobs based on type.
| * Add an `:only` option to `perform_enqueued_jobs` to filter jobs based onMichael Ryan2015-02-064-18/+186
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | type. This allows specific jobs to be tested, while preventing others from being performed unnecessarily. Example: def test_hello_job assert_performed_jobs 1, only: HelloJob do HelloJob.perform_later('jeremy') LoggingJob.perform_later end end An array may also be specified, to support testing multiple jobs. Example: def test_hello_and_logging_jobs assert_nothing_raised do assert_performed_jobs 2, only: [HelloJob, LoggingJob] do HelloJob.perform_later('jeremy') LoggingJob.perform_later('stewie') RescueJob.perform_later('david') end end end Fixes #18802. Trim space and document :only option.
* Significantly improve the performance of `_read_attribute` on JRubySean Griffin2015-02-062-4/+21
| | | | | | | | | | | | | The `&block` form is more than twice as fast as the manual form of delegation (and is the code I'd rather write anyway). Unfortunately, it's still twice as slow on MRI. However, this is enough of a hotspot to justify giving JRuby special treatment. I can't currently provide benchmarks in the context of Active Record, since the JDBC adapters still aren't updated for 4.2, but the actual work performed (assuming it's been read at least once already) will have nearly the same performance characteristics as https://gist.github.com/sgrif/b86832786551aaee74de.
* Use keyword argument in the find_in_batches APIRafael Mendonça França2015-02-061-11/+7
| | | | | We already validate the keys, so it is better to use the built-in feature to do this
* Allow a symbol to be passed to `attribute`, in place of a type objectSean Griffin2015-02-0616-22/+148
| | | | | | | | | | | | | | | | | | The same is not true of `define_attribute`, which is meant to be the low level no-magic API that sits underneath. The differences between the two APIs are: - `attribute` - Lazy (the attribute will be defined after the schema has loaded) - Allows either a type object or a symbol - `define_attribute` - Runs immediately (might get trampled by schema loading) - Requires a type object This was the last blocker in terms of public interface requirements originally discussed for this feature back in May. All the implementation blockers have been cleared, so this feature is probably ready for release (pending one more look-over by me).
* Merge branch 'rm-ntp'Rafael Mendonça França2015-02-064-27/+40
|\ | | | | | | Merge #12067 rebasing and improving the code.
| * Merge pull request #12067 from jackxxu/keep_precisionRafael Mendonça França2015-02-064-27/+40
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Enable number_to_percentage to keep the number's precision by allowing :precision option value to be nil Conflicts: activesupport/CHANGELOG.md activesupport/lib/active_support/number_helper.rb activesupport/test/number_helper_test.rb
| | * Enable number_to_percentage to keep the number's precision by allowing ↵Jack Xu2013-08-283-16/+31
| | | | | | | | | | | | | | | | | | :precision to be nil number_helper.number_to_percentage(1000, precision: nil) # => "1000%"
* | | Merge pull request #18831 from colinrymer/patch-1Rafael Mendonça França2015-02-061-2/+2
|\ \ \ | | | | | | | | Indicate link_to creates an anchor element
| * | | Indicate link_to creates an anchor elementColin Rymer2015-02-061-2/+2
| |/ / | | | | | | | | | | | | | | | The `link_to` helper generates an HTML anchor element (consisting of opening and closing anchor tags and an element body). The docs currently state the a link tag is generated (which would indicate a tag like `<link>`, which is another valid HTML tag), so this change clarifies that an anchor element is actually generated. [ci skip]
* / / Revert "Improve the performance of HWIDA `select` and `reject`"Sean Griffin2015-02-061-4/+4
|/ / | | | | | | This reverts commit 9c47b874d112414df7f80f9ed852adb48ba6d268.
* | Improve the performance of HWIDA `select` and `reject`Sean Griffin2015-02-061-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are (potentially, depending on input) called in several places in both the router, and Active Record. The code also becomes much cleaner. This results in ~33% performance gain in both methods. Calculating ------------------------------------- before 15.696k i/100ms after 19.865k i/100ms ------------------------------------------------- before 303.064k (± 2.6%) i/s - 1.523M after 446.734k (± 2.4%) i/s - 2.245M On Ruby 2.2, a warning will be emitted about states not being copied, because we're calling `super` from a subclass. We can safely ignore it, however, since we're converting the result back into a HWIDA
* | Merge pull request #14028 from uberllama/json_escape_commentsRafael Mendonça França2015-02-061-0/+5
|\ \ | | | | | | Amended json_escape comments
| * | Amended json_escape comment to clarify that user-generated content must ↵Yuval Kordov2014-02-121-0/+5
| | | | | | | | | | | | still be html_escaped if being inserted ingot he DOM via JQuery's html() method.
* | | Merge pull request #18388 from claudiob/better-docs-for-active-model-lint-testsRafael Mendonça França2015-02-061-28/+32
|\ \ \ | | | | | | | | Better docs for AM::Lint::Tests
| * | | Better docs for AM::Lint::Testsclaudiob2015-01-071-28/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit changes the original documentation of ActiveModel::Lint::Tests introduced in dbf20c2d to focus less on *why* the tests exist and more on *what* the tests do. For instance, `test_to_key` was documented as: > Returns an Enumerable of all (primary) key attributes... whereas `test_to_key` is simply a test meant to *fail* or *pass*, and the documentation above refers to `to_key`. [ci skip]
* | | | revises AM:Dirty example [Godfrey Chan & Xavier Noria]Xavier Noria2015-02-061-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing example seems somewhat forced: is it realistic to have a model that accepts state in its initializer but considers it has not been changed? By allowing state changes to happen only via accessors it seems more natural that new instances are considered to be unchanged (as they are in AR). [ci skip]
* | | | use parentheses here, for the beard of the Prophet! [ci skip]Xavier Noria2015-02-061-1/+1
| | | |
* | | | applies guidelines to dirty.rb [ci skip]Xavier Noria2015-02-061-11/+11
| | | |
* | | | Merge pull request #18399 from kommen/unify-structure-file-envvar-namesRafael Mendonça França2015-02-053-4/+10
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use SCHEMA instead of DB_STRUCTURE for specifiying structure file. Conflicts: activerecord/CHANGELOG.md
| * | | | Use `SCHEMA` instead of `DB_STRUCTURE` for specifiying structure file.Dieter Komendera2015-01-083-4/+10
| |/ / / | | | | | | | | | | | | | | | | `rake test:load_structure` already uses `SCHEMA` and there's no need to maintain two different env vars.
* | | | Merge pull request #18589 from kamipo/fix_test_types_line_upRafael Mendonça França2015-02-051-2/+2
|\ \ \ \ | | | | | | | | | | Fix `test_types_line_up` when column type missing
| * | | | Fix `test_types_line_up` when column type missingRyuta Kamizono2015-01-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a column type `xml` is missing in regexp pattarn. However, `assert_equal 1, lengths.uniq.length` is success when `lengths` are all `nil` because a column type is missing. a test will be failed by using `compact` when a column type is missing.
* | | | | Merge pull request #18526 from vipulnsward/add-silence-streamRafael Mendonça França2015-02-059-150/+63
|\ \ \ \ \ | | | | | | | | | | | | Extracted silence_stream method to new module in activesupport/testing
| * | | | | - Extracted silence_stream method to new module in activesupport/testing.Vipul A M2015-01-209-150/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added include for the same in ActiveSupport::Test. - Removed occurrences of silence_stream being used elsewhere. - Reordered activesupport testcase requires alphabetically. - Removed require of silence stream from test_case - Moved quietly method to stream helper - Moved capture output to stream helper module and setup requires for the same elsewhere
* | | | | | Merge pull request #18771 from kirs/deprecate-xhrRafael Mendonça França2015-02-0510-119/+161
|\ \ \ \ \ \ | | | | | | | | | | | | | | Migrating xhr methods to keyword arguments syntax
| * | | | | | Migrating xhr methods to keyword arguments syntaxKir Shatrov2015-02-0110-119/+161
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in `ActionController::TestCase` and `ActionDispatch::Integration` Old syntax: `xhr :get, :create, params: { id: 1 }` New syntax example: `get :create, params: { id: 1 }, xhr: true`
* | | | | | | Use keyword argumentsRafael Mendonça França2015-02-051-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also remove the default value since it will be always passed and Array(nil) returns an empty array
* | | | | | | Merge pull request #18747 from vipulnsward/merge-skip-callbackRafael Mendonça França2015-02-051-2/+2
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Rename AS::Callback#merge
| * | | | | | | Callback#merge merges options for a callback skip instead of a callback. ↵Vipul A M2015-02-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Renamed it to indicate what it actually does.
* | | | | | | | Do not run remove_connection in memory db testRafael Mendonça França2015-02-051-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will make rake test_sqlite3_mem work again
* | | | | | | | Mark some methods as nodocRafael Mendonça França2015-02-051-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | They are implementation details