aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | | | | | | | Fix wrong timezone mapping for Switzerland [22233]Kacper Walanus2015-11-151-1/+2
| | | | | | | | | | | | |
* | | | | | | | | | | | | Merge pull request #22370 from yui-knk/remove_blank_lineAndrew White2015-11-241-1/+0
|\ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove a blank line from a template for plugin `routes.rb`
| * | | | | | | | | | | | | Remove a blank line from a template for plugin `routes.rb`yui-knk2015-11-221-1/+0
| | |_|_|_|/ / / / / / / / | |/| | | | | | | | | | |
* | | | | | | | | | | | | Merge pull request #22304 from ↵Yves Senn2015-11-244-104/+161
|\ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | kamipo/schema_dumping_support_for_postgresql_geometric_types Add schema dumping support for PostgreSQL geometric data types
| * | | | | | | | | | | | | Add schema dumping support for PostgreSQL geometric data typesRyuta Kamizono2015-11-243-11/+77
| | | | | | | | | | | | | |
| * | | | | | | | | | | | | Move `migration/postgresql_geometric_types_test.rb` in ↵Ryuta Kamizono2015-11-242-93/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `adapters/postgresql/geometric_test.rb`
* | | | | | | | | | | | | | Merge pull request #22214 from ↵Rafael França2015-11-244-15/+6
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | kamipo/not_passing_native_database_types_to_table_definition Not passing `native_database_types` to `TableDefinition`
| * | | | | | | | | | | | | | Not passing `native_database_types` to `TableDefinition`Ryuta Kamizono2015-11-084-15/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `native_database_types` only used in `TableDefinition` for look up the default `:limit` option. But this is duplicated process with `type_to_sql`. Passing `native_database_types` is not needed.
* | | | | | | | | | | | | | | Merge pull request #22172 from tijmenb/fix-source-in-show-exceptionRafael França2015-11-243-0/+16
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add text template for source code
| * | | | | | | | | | | | | | | Add text template for source codeTijmen Brommet2015-11-033-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a request is made with AJAX and an error occurs, Rails will render a text-template for the exception instead of the HTML error page (#11960). The `.text.erb` variant of the `_source` template is currently missing, causing HTML to be rendered in the response. This commit adds the text template. To keep the page scannable we only only show the first three source extracts. Related to #14745. Before: ``` ~/testing-exceptions ᐅ curl 'http://localhost:3000/' -H 'X-Requested-With: XMLHttpRequest' RuntimeError in PostsController#index <div class="source " id="frame-source-0"> <div class="info"> Extracted source (around line <strong>#3</strong>): </div> <div class="data"> <table cellpadding="0" cellspacing="0" class="lines"> <tr> ``` After: ``` ~/testing-exceptions ᐅ curl 'http://localhost:3000/' -H 'X-Requested-With: XMLHttpRequest' RuntimeError in PostsController#index Extracted source (around line #3): *3 raise ```
* | | | | | | | | | | | | | | | Move all nodoc methods to the private sectionRafael Mendonça França2015-11-241-43/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since they are nodoc there is no need to be protected.
* | | | | | | | | | | | | | | | Put all private method togetherRafael Mendonça França2015-11-241-36/+35
| | | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | Avoid mutating the headers hashRafael Mendonça França2015-11-241-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We are already filtering the keys in the assign_headers_to_message method so we can just update the filter.
* | | | | | | | | | | | | | | | nodoc in the private methodRafael Mendonça França2015-11-241-1/+1
| | | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | Merge pull request #22120 from hnatt/refactor-actionmailerRafael Mendonça França2015-11-241-55/+59
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor ActionMailer::Base
| * | | | | | | | | | | | | | | | Rename ActionMailer::Base#class_from_value -> observer_class_forhnatt2015-10-301-4/+4
| | | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | Don't mutate headers in ActionMailer::Base#collect_responses_from_templateshnatt2015-10-301-2/+2
| | | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | Pass message as argument to ActionMailer::Base#assign_headers_to_messagehnatt2015-10-301-4/+5
| | | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | Fix indentation in ActionMailer::Base#collect_responses_from_templateshnatt2015-10-291-5/+5
| | | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | Refactor out headers to message assignment from ActionMailer::Base#mailhnatt2015-10-291-3/+6
| | | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | Use attr_internal in ActionMailer::Base#mail instead of local var for messagehnatt2015-10-291-11/+9
| | | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | Refactor out defaults handling from ActionMailer::Base#mailhnatt2015-10-291-9/+15
| | | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | Refactor ActionMailer::Base#collect_responseshnatt2015-10-291-16/+16
| | | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | Reduce code duplication in ActionMailer::Base#register_observer and ↵hnatt2015-10-291-16/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #register_interceptor
* | | | | | | | | | | | | | | | | Merge pull request #22287 from dharamgollapudi/patch-2Rafael França2015-11-241-2/+1
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the desc one level up
| * | | | | | | | | | | | | | | | | Move the desc one level up Dharam Gollapudi2015-11-131-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the task visible (from rake -T) by moving the desc one level up
* | | | | | | | | | | | | | | | | | Merge pull request #22390 from ↵Rafael França2015-11-231-2/+2
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | jacobbednarz/update-valgrind-docs-for-macosx-support Remove valgrind note about linux only support
| * | | | | | | | | | | | | | | | | | Remove valgrind note about linux only supportJacob Bednarz2015-11-241-2/+2
|/ / / / / / / / / / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update the valgrind debugging documentation to remove the notes about being linux only as 3.11.0[1] introduces preliminary support for Mac OSX 10.11 (El Capitan). [1]: http://valgrind.org/docs/manual/dist.news.html
* | | | | | | | | | | | | | | | | | Merge pull request #22272 from y-yagi/remove_test_files_in_plugin_gemspecEileen M. Uchitelle2015-11-231-3/+0
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | don't package test files in plugin gemspec
| * | | | | | | | | | | | | | | | | | don't package test files in plugin gemspecyuuji.yaginuma2015-11-121-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In rails engine, there is a dummy application under test, the size of the test file is increased. However, there is no need test files for most users, I think it good to have so as not included by default.
* | | | | | | | | | | | | | | | | | | Merge pull request #22388 from ↵Sean Griffin2015-11-233-9/+8
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | kamipo/set_field_encoding_is_only_needed_for_mysql_adapter `set_field_encoding` is only needed for `MysqlAdapter`
| * | | | | | | | | | | | | | | | | | | `set_field_encoding` is only needed for `MysqlAdapter`Ryuta Kamizono2015-11-243-9/+8
| | |_|_|_|_|/ / / / / / / / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not needed for `Mysql2Adapter` and `AbstractMysqlAdapter`.
* | | | | | | | | | | | | | | | | | | Fix more test failures caused by #21000Sean Griffin2015-11-231-1/+5
| | | | | | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | | | | Fix test failures caused by #21000Sean Griffin2015-11-231-0/+1
| | | | | | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | | | | Revert "Merge pull request #18446 from ↵Sean Griffin2015-11-234-137/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cloud8421/actionmailer-unregister-interceptor" This reverts commit 65a61ab7c370d2894c11ce276725f723a5c9c111, reversing changes made to 14314ca18302f18c3d8bb7a63e9f71ac4c2290c2. This PR broke the build
* | | | | | | | | | | | | | | | | | | Merge pull request #21000 from twalpole/find_or_parameter_issuesSean Griffin2015-11-237-44/+101
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update and fix forbidden attributes test issues caused by AC::Parameters change
| * | | | | | | | | | | | | | | | | | | Update and fix forbidden attributes testsThomas Walpole2015-11-037-44/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add AC::Parameters tests for WhereChain#not
* | | | | | | | | | | | | | | | | | | | Merge pull request #22385 from headius/each_object_singleton_testSean Griffin2015-11-231-2/+3
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test if each_object(singleton_class) works, since JRuby added it.
| * | | | | | | | | | | | | | | | | | | | Test if each_object(singleton_class) works, since JRuby added it.Charles Oliver Nutter2015-11-231-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #22376. JRuby 9.0.5.0 will support ObjectSpace.each_object against a class's singleton class, since that's essentially just walking an internal subclasses structure we already maintain. This test was too narrow, requiring that each_object support an arbitrary class but only actually needing it to work against a class's singleton. This improves performance of Class.descendants by nearly two orders of magnitude when run against JRuby 9.0.5.0: ```ruby 5.times { puts Benchmark.measure { 100_000.times { Numeric.descendants } } } ``` Before: ``` 11.510000 0.140000 11.650000 ( 10.082384) 9.990000 0.020000 10.010000 ( 9.931233) 10.520000 0.040000 10.560000 ( 10.502978) 10.290000 0.030000 10.320000 ( 10.276027) 10.000000 0.030000 10.030000 ( 9.942429) ``` After: ``` 1.380000 0.040000 1.420000 ( 0.365850) 0.210000 0.000000 0.210000 ( 0.149574) 0.180000 0.020000 0.200000 ( 0.141094) 0.140000 0.000000 0.140000 ( 0.140634) 0.190000 0.010000 0.200000 ( 0.147962) ```
* | | | | | | | | | | | | | | | | | | | | Merge pull request #17013 from gsamokovarov/fix-null-resolverSean Griffin2015-11-231-2/+1
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix improper value types used to instantiate a Template in AV::NullResol...
| * | | | | | | | | | | | | | | | | | | | | Fix improper value types used to instantiate a Template in AV::NullResolverGenadi Samokovarov2014-09-221-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While trying to provide a reproducible test for #17008 I stumbled on this one. Seems to be quite an old piece of code, but its definitely useful in situations like the reproducible test cases like the one above.
* | | | | | | | | | | | | | | | | | | | | | Merge pull request #17928 from sergey-alekseev/remove-unused-form-data-methodSean Griffin2015-11-232-3/+29
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | | | | | | | | | | | | | write a test for `#form_data?`Sergey Alekseev2015-03-312-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The initial attempt was to remove the method at all in https://github.com/sergey-alekseev/rails/commit/4926aa68c98673e7be88a2d2b57d72dc490bc71c. The method overrides Rack's `#form_data?` https://github.com/rack/rack/blob/6f8808d4201e68e4bd780441b3b7bb3ee6d1f43e/lib/rack/request.rb#L172-L184. Which may have some incorrect implementation actually. `type.nil?` isn't possible I suppose. I'll check.
* | | | | | | | | | | | | | | | | | | | | | | Merge pull request #18446 from cloud8421/actionmailer-unregister-interceptorSean Griffin2015-11-234-19/+137
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | |_|_|_|_|/ / / / / / / / / / / / / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ActionMailer::Base can unregister interceptor(s).
| * | | | | | | | | | | | | | | | | | | | | | ActionMailer::Base can unregister interceptor(s).Claudio Ortolina2015-01-314-19/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One or multiple mail interceptors can be unregistered using `ActionMailer::Base.unregister_interceptors` or `ActionMailer::Base.unregister_interceptor`. For preview interceptors, it's possible to use `ActionMailer::Base.unregister_preview_interceptors` or `ActionMailer::Base.unregister_preview_interceptor`. Refactors logic to constantize a string/symbol into separate method.
* | | | | | | | | | | | | | | | | | | | | | | Merge pull request #22372 from greysteil/clearer-ip-spoofing-commentRichard Schneeman2015-11-231-7/+15
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clearer comment and variable name on IP spoofing
| * | | | | | | | | | | | | | | | | | | | | | | Clearer comment and variable name on IP spoofingGrey Baker2015-11-221-7/+15
| | | | | | | | | | | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | | | | | | | | | Remove blanket array delegation from `Relation`Sean Griffin2015-11-232-20/+2
| |_|_|_|/ / / / / / / / / / / / / / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As was pointed out by #17128, our blacklist of mutation methods was non-exhaustive (and would need to be kept up to date with each new version of Ruby). Now that `Relation` includes `Enumerable`, the number of methods that we actually need to delegate are pretty small. As such, we can change to explicitly delegating the few non-mutation related methods that `Array` has which aren't on `Enumerable`
* | | | | | | | | | | | | | | | | | | | | | | Merge pull request #22374 from DNNX/patch-1Rafael França2015-11-231-1/+1
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simplify `RailsGuides::Generator#select_only` a bit
| * | | | | | | | | | | | | | | | | | | | | | | Simplify `RailsGuides::Generator#select_only` a bitViktar Basharymau2015-11-221-1/+1
| | |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main goal is to improve readability, but as a side effect this commit makes the method a bit faster.