aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | Allow symbol as values for `tokenize` of `LengthValidator`kakipo2014-08-034-7/+32
| | | | | | |
* | | | | | | Merge pull request #18924 from tgxworld/correct_module_in_depre_msgKasper Timm Hansen2015-02-131-1/+1
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Correct module name in deprecation message.
| * | | | | | | Correct module name in deprecation message.Guo Xiang Tan2015-02-131-1/+1
|/ / / / / / /
* | | | | | | Merge pull request #18923 from tgxworld/fix_deprecation_warning_messageKasper Timm Hansen2015-02-131-4/+3
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Improve deprecation warning message
| * | | | | | | Improve deprecation message.Guo Xiang Tan2015-02-131-1/+3
| | | | | | | |
| * | | | | | | Do not recommend `xhr` since it is going to be deprecated.Guo Xiang Tan2015-02-131-3/+0
| | | | | | | |
* | | | | | | | remove CHANGELOG entry for Rails 5.0 only feature. #18918Yves Senn2015-02-131-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `has_secure_token` hasen't been released yet. No need to track every change in the CHANGELOG.
* | | | | | | | Merge pull request #18918 from ↵Yves Senn2015-02-133-2/+15
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | morgoth/do-not-overwrite-value-of-secret-token-when-present Do not overwrite secret token value when already present.
| * | | | | | | | Do not overwrite secret token value when already present.Wojciech Wnętrzak2015-02-123-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ``` user = User.create(token: "custom-secure-token") user.token # => "custom-secure-token" ```
* | | | | | | | | Merge pull request #18922 from yui-knk/fix/action_controller_overviewYves Senn2015-02-131-1/+1
|\ \ \ \ \ \ \ \ \ | |_|/ / / / / / / |/| | | | | | | | [ci skip] escape under score
| * | | | | | | | [ci skip] escape under scoreyui-knk2015-02-131-1/+1
| |/ / / / / / /
* | | | | | | | Merge pull request #18919 from nerdrew/missing-rack-utils-requireArthur Nogueira Neves2015-02-121-0/+1
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | require rack/utils in exception_wrapper
| * | | | | | | require rack/utils in exception_wrapperAndrew Lazarus2015-02-121-0/+1
|/ / / / / / /
* | | | | | | remove meta programmingAaron Patterson2015-02-121-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | there's really no benefit here. It's the same number of lines without the meta programming and is faster
* | | | | | | there is always an integration session, so remove the checkAaron Patterson2015-02-121-1/+0
| | | | | | |
* | | | | | | lazily create the integration sessionAaron Patterson2015-02-122-11/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | now we don't have to call reset! everywhere
* | | | | | | use before_setup to set up test instance variablesAaron Patterson2015-02-121-7/+6
| | | | | | |
* | | | | | | Skip url_helpers instead of caching, speed up integration testseileencodes2015-02-122-18/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We shouldn't cache if it's not absolutely necessary. Removes route caching and instead skips using the `url_helpers` is the integration test session doesn't require it. Benchmark ips on integration and controller index method tests below. Without any caching or changes to `#url_helpers`: ``` Calculating ------------------------------------- INDEX: Integration Test 71.000 i/100ms INDEX: Functional Test 99.000 i/100ms ------------------------------------------------- INDEX: Integration Test 728.878 (± 8.0%) i/s - 3.692k INDEX: Functional Test 1.015k (± 6.7%) i/s - 5.148k Comparison: INDEX: Functional Test: 1015.4 i/s INDEX: Integration Test: 728.9 i/s - 1.39x slower ``` With caching on `#url_helpers`: ``` Calculating ------------------------------------- INDEX: Integration Test 74.000 i/100ms INDEX: Functional Test 99.000 i/100ms ------------------------------------------------- INDEX: Integration Test 752.377 (± 6.9%) i/s - 3.774k INDEX: Functional Test 1.021k (± 6.7%) i/s - 5.148k Comparison: INDEX: Functional Test: 1021.1 i/s INDEX: Integration Test: 752.4 i/s - 1.36x slower ``` Afer removing the caching and bypassing the `url_helpers` when not necessary in the session: ``` Calculating ------------------------------------- INDEX: Integration Test 87.000 i/100ms INDEX: Functional Test 97.000 i/100ms ------------------------------------------------- INDEX: Integration Test 828.433 (± 6.4%) i/s - 4.176k INDEX: Functional Test 926.763 (± 7.2%) i/s - 4.656k Comparison: INDEX: Functional Test: 926.8 i/s INDEX: Integration Test: 828.4 i/s - 1.12x slower ```
* | | | | | | Merge pull request #18915 from kamipo/extract_date_time_precision_testRafael Mendonça França2015-02-124-271/+102
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Extract `DateTimePrecisionTest`
| * | | | | | | Extract `DateTimePrecisionTest`Ryuta Kamizono2015-02-134-271/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The datetime precision tests for any adapters is duplicated.
* | | | | | | | Optimize none? and one? relation query methods to use LIMIT and COUNT.Eugene Gilburg2015-02-126-2/+162
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use SQL COUNT and LIMIT 1 queries for none? and one? methods if no block or limit is given, instead of loading the entire collection to memory. The any? and many? methods already follow this behavior. [Eugene Gilburg & Rafael Mendonça França]
* | | | | | | Merge pull request #18844 from ↵Zachary Scott2015-02-121-0/+15
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | yuki24/guides-add-render-example-without-partial-and-locals Add tip for skipping `partial` and `locals` options for `render`
| * | | | | | | Add tip for skipping `partial` and `locals` options for `render`Yuki Nishijima2015-02-081-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ci skip]
* | | | | | | | Merge pull request #11790 from printercu/patch-3Rafael Mendonça França2015-02-123-14/+39
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | ActionController#translate supports symbols
| * | | | | | | | ActionController#translate also lookups shortcut without action nameMax Melentiev2013-10-223-4/+13
| | | | | | | | |
| * | | | | | | | ActionController#translate supports symbolsprintercu2013-09-253-12/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Made it similar to views helper.
* | | | | | | | | Merge pull request #18886 from kamipo/allow_precision_option_for_time_columnRafael Mendonça França2015-02-127-19/+90
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Allow `:precision` option for time type columns
| * | | | | | | | | Allow `:precision` option for time type columnsRyuta Kamizono2015-02-127-19/+90
| | | | | | | | | |
* | | | | | | | | | Merge pull request #18885 from ypxing/masterRafael Mendonça França2015-02-121-12/+7
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | remove unnecessary assignment/parameter passing in AS::Callbacks...::Around (master branch)
| * | | | | | | | | | remove unnecessary assignment and parameter passing in ↵rxing2015-02-111-12/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ActiveSupport::Callbacks::Filters::Around
* | | | | | | | | | | get rid of transaction warning when running PG tests.Yves Senn2015-02-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This finally removes the warning "WARNING: there is no transaction in progress" when running Active Record tests using PostgreSQL.
* | | | | | | | | | | pg tests, be clear about the missing type that causes a test skip.Yves Senn2015-02-122-15/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also removed some cruft in the `setup` and `teardown` methods.
* | | | | | | | | | | tests, remove unused requires.Yves Senn2015-02-122-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "active_support/testing/stream" is already required in `test_case.rb`. Furthermore the test "test/cases/migration_test.rb" could no longer be executed directly.
* | | | | | | | | | | Merge pull request #18911 from y-yagi/fix-typoKasper Timm Hansen2015-02-121-3/+3
|\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | fix typo in fresh_when example [ci skip]
| * | | | | | | | | | | fix typo in fresh_when example [ci skip]yuuji.yaginuma2015-02-121-3/+3
| | | | | | | | | | | |
* | | | | | | | | | | | Merge pull request #18907 from square/dont-load-app-on-structureYves Senn2015-02-121-1/+1
|\ \ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / / |/| | | | | | | | | | | Schema creation doesn't load the app
| * | | | | | | | | | | Schema creation doesn't load the appTamir Duberstein2015-02-111-1/+1
| | |/ / / / / / / / / | |/| | | | | | | | |
* / | | | | | | | | | Properly dump primitive-like AS::SafeBuffer strings as YAMLGodfrey Chan2015-02-113-1/+29
|/ / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `coder.represent_scalar` means something along the lines of "Here is a quoted string, you can just add it to the output", which is not the case here. It only works for simple strings that can appear unquoted in YAML, but causes problems for e.g. primitive-like strings ("1", "true"). `coder.represent_object` on the other hand, means that "This is the Ruby-object representation for this thing suitable for use in YAML dumping", which is what we want here. Before: YAML.load ActiveSupport::SafeBuffer.new("Hello").to_yaml # => "Hello" YAML.load ActiveSupport::SafeBuffer.new("true").to_yaml # => true YAML.load ActiveSupport::SafeBuffer.new("false").to_yaml # => false YAML.load ActiveSupport::SafeBuffer.new("1").to_yaml # => 1 YAML.load ActiveSupport::SafeBuffer.new("1.1").to_yaml # => 1.1 After: YAML.load ActiveSupport::SafeBuffer.new("Hello").to_yaml # => "Hello" YAML.load ActiveSupport::SafeBuffer.new("true").to_yaml # => "true" YAML.load ActiveSupport::SafeBuffer.new("false").to_yaml # => "false" YAML.load ActiveSupport::SafeBuffer.new("1").to_yaml # => "1" YAML.load ActiveSupport::SafeBuffer.new("1.1").to_yaml # => "1.1" If we ever want Ruby to behave more like PHP or JavaScript though, this is an excellent trick to use ;)
* | | | | | | | | | Don't break enum on PGSean Griffin2015-02-111-1/+1
| | | | | | | | | |
* | | | | | | | | | Refactor enum to be defined in terms of the attributes APISean Griffin2015-02-113-44/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In addition to cleaning up the implementation, this allows type casting behavior to be applied consistently everywhere. (#where for example). A good example of this was the previous need for handling value to key conversion in the setter, because the number had to be passed to `where` directly. This is no longer required, since we can just pass the string along to where. (It's left around for backwards compat) Fixes #18387
* | | | | | | | | | `current_scope` shouldn't pollute sibling STI classesSean Griffin2015-02-114-6/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It looks like the only reason `current_scope` was thread local on `base_class` instead of `self` is to ensure that when we call a named scope created with a proc on the parent class, it correctly uses the default scope of the subclass. The reason this wasn't happening was because the proc captured `self` as the parent class, and we're not actually defining a real method. Using `instance_exec` fixes the problem. Fixes #18806
* | | | | | | | | | Merge pull request #18888 from kamipo/refactor_quote_default_expressionRafael Mendonça França2015-02-114-18/+12
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Refactor `quote_default_expression`
| * | | | | | | | | | Refactor `quote_default_expression`Ryuta Kamizono2015-02-114-18/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `quote_default_expression` and `quote_default_value` are almost the same handling for do not quote default function of `:uuid` columns. Rename `quote_default_value` to `quote_default_expression`, and remove duplicate code.
* | | | | | | | | | | Merge pull request #18906 from awd/fix-test-descriptionRafael Mendonça França2015-02-111-1/+1
|\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Fixes incorrect wording of test description
| * | | | | | | | | | | Fixes wording of test descriptionAdam Doeler2015-02-111-1/+1
| | | | | | | | | | | |
* | | | | | | | | | | | Merge pull request #18374 from claudiob/add-collection-to-fresh-whenRafael Mendonça França2015-02-113-11/+103
|\ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | Accept a collection in fresh_when and stale?
| * | | | | | | | | | | | Accept a collection in fresh_when and stale?claudiob2015-02-103-11/+103
| | |/ / / / / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The methods `fresh_when` and `stale?` from ActionController::ConditionalGet accept a single record as a short form for a hash. For instance ```ruby def show @article = Article.find(params[:id]) fresh_when(@article) end ``` is just a short form for: ```ruby def show @article = Article.find(params[:id]) fresh_when(etag: @article, last_modified: @article.created_at) end ``` This commit extends `fresh_when` and `stale?` to also accept a collection of records, so that a short form similar to the one above can be used in an `index` action. After this commit, the following code: ```ruby def index @article = Article.all fresh_when(etag: @articles, last_modified: @articles.maximum(:created_at)) end ``` can be simply written as: ```ruby def index @article = Article.all fresh_when(@articles) end ```
* | | | | | | | | | | | Merge pull request #18845 from bogdan/remove-code-dups-in-action-viewRafael Mendonça França2015-02-112-33/+25
|\ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | Remove some code duplication in ActionView tags code
| * | | | | | | | | | | | Remove code duplication in ActionView::Helpers::Tags::BaseBogdan Gusiev2015-02-112-33/+25
| | | | | | | | | | | | |
* | | | | | | | | | | | | Revert 88d08f2ec9f89ba431cba8d0c06ac9ebc204bbbbRafael Mendonça França2015-02-112-13/+25
| |_|/ / / / / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This caused a performance regression since we were decided to do the nil check in run time not in the load time. See https://github.com/rails/rails/pull/15187#issuecomment-71760058