| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Reason: That one is an Oxford comma, as per our guidelines. See:
http://edgeguides.rubyonrails.org/api_documentation_guidelines.html#comma
This reverts commit f184cd34f9ef35ddf85a23c2fb02cc05d3fb26b3.
|
|\ \ \
| | | |
| | | | |
[ci skip] removed extra comma
|
|/ / / |
|
| | |
| | |
| | |
| | | |
[ci skip]
|
|\ \ \
| | | |
| | | | |
Use sufficient a regexp anchor to check `@response.content_type.to_s`
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This commit follows up of ea9bc06c9a47b839d5e2db94ba6bf7e29c8f0ae9.
To check `@response.content_type.to_s` is ended with `"xml"`,
to use `\z` is sufficient.
|
|\ \ \ \
| | | | |
| | | | | |
Refactored association preloader for performance
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
* less arrays created
* less complexity with only one level of nesting in loop
|
|\ \ \ \ \
| |_|/ / /
|/| | | | |
Change Integer#year to return a Fixnum instead of a Float to improve consistency
|
| | | | | |
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
Suppress warnings (warnings about AD::IntegrationTest HTTP request)
|
|/ / / /
| | | |
| | | |
| | | |
| | | | |
These warings have been appeared from
ea9bc06c9a47b839d5e2db94ba6bf7e29c8f0ae9.
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | | |
rafaelsales/issues/21922-fix-ar-group-by-attribute-lookup
Fix generated projection fields in group by query
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
* When tried to use `Company#accounts` test/models/company.rb I got:
```
ActiveRecord::StatementInvalid: SQLite3::SQLException: no such column:
accounts.company_id: SELECT COUNT(*) AS count_all, "companies"."firm_id"
AS companies_firm_id FROM "companies" INNER JOIN "accounts" ON
"accounts"."company_id" = "companies"."id" GROUP BY "companies"."firm_id"
```
* The refactor on Calculations class was just to simplify the code
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Closes #21922
Let `Book(id, author_id)`, `Photo(id, book_id, author_id)` and `Author(id)`
Running `Book.group(:author_id).joins(:photos).count` will produce:
* Rails 4.2 - conflicts `author_id` in both projection and group by:
```sql
SELECT COUNT(*) AS count_all, author_id AS author_id
FROM "books" INNER JOIN "photos" ON "photos"."book_id" = "books"."id"
GROUP BY author_id
```
* Master (9d02a25) - conflicts `author_id` only in projection:
```sql
SELECT COUNT(*) AS count_all, author_id AS author_id
FROM "books" INNER JOIN "photos" ON "photos"."book_id" = "books"."id"
GROUP BY "books"."author_id"
```
* With this fix:
```sql
SELECT COUNT(*) AS count_all, "books"."author_id" AS books_author_id
FROM "books" INNER JOIN "photos" ON "photos"."book_id" = "books"."id"
GROUP BY "books"."author_id"
```
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
Remove `#tables` extra args again
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | | |
This issue was resolved by #21687 already. But re-add args by #18856.
`#tables` extra args was only using by `#table_exists?`. This is for
internal API. This commit will remove these extra args again.
|
|\ \ \ \
| | | | |
| | | | | |
remove unnecessary forwardable require
|
|/ / / /
| | | |
| | | | |
`Forwardable` has been used in the past
|
|\ \ \ \
| | | | |
| | | | | |
Extract native getter to attr_reader.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The getter is doing nothing more than returning the ivar, so it can be
extracted to an attr_reader.
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
Fix warnings in multiple application tests
|
|/ / / /
| | | |
| | | |
| | | |
| | | | |
This is primarily to fix method redefinition warnings in class_attribute
but may be of use in other places where we define singleton methods.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
[ci skip]
It's been a source of confusion that the lower-level `add_column`
referenced the higher level `column` method for available options.
`column` supports additional functionality like `index: true` that is
not present on `add_column`.
This patch moves common option documentation to `add_column` and only
documents the additional options in `column`.
|
|\ \ \ \
| |_|/ /
|/| | | |
typo
|
|/ / / |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Ok, this explains why the branch showed as green. We don't run files in
isolation for PRs, only for master. Active Support monkeypatches
`BigDecimal#to_s`, so the generated error message was different
depending on if the file was run in isolation
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The error message when asserting `greater_than: BigDecimal.new` will
give an error message based on how BigDecimal displays itself. Big
decimal appears to always use scientific notation. This might not be the
best error message for the general case, but the general case wouldn't
use big decimal for the validation. And if they do, they likely need
this level of precision.
|
|\ \ \
| | | |
| | | | |
Revert " Added an example to show how common secrets can be shared ac…
|
|/ / /
| | |
| | |
| | | |
multiple environments in secrets.yml"
|
|\ \ \
| | | |
| | | | |
Use the post-type-cast version of the attribute to validate numericality
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This fixes the issue where you may be comparing (using a numeric
validator such as `greater_than`) numbers of a specific Numeric type
such as `BigDecimal`.
Previous behavior took the numeric value to be validated and
unconditionally converted to Float. For example, due to floating point
precision, this can cause issues when comparing a Float to a BigDecimal.
Consider the following:
```
validates :sub_total, numericality: {
greater_than: BigDecimal('97.18')
}
```
If the `:sub_total` value BigDecimal.new('97.18') was validated against
the above, the following would be valid since `:sub_total` is converted
to a Float regardless of its original type. The result therefore becomes
Kernel.Float(97.18) > BigDecimal.new('97.18')
The above illustrated behavior is corrected with this patch by
conditionally converting the value to validate to float.
Use the post-type-cast version of the attribute to validate numericality
[Roque Pinel & Trevor Wistaff]
|
|\ \ \ \
| | | | |
| | | | | |
FileStore: Long cache keys may result in too long paths due to encoding
|
| | | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Added an example to show how common secrets can be shared across multiple environments in secrets.yml [ci skip]
|
| | | | | | |
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | |
| | | | | | | |
Fix for activerecord join dependency instantiate bug
|
|/| | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This is a separate commit, as it is not just a changelog conflict. Want
to point out the changes in the code
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
use only object_id instead parent class and parent id
test cases
assert_equal
use table name in references
fix minor problems
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Handle invalid UTF-8 strings when HTML escaping
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Use `ActiveSupport::Multibyte::Unicode.tidy_bytes` to handle invalid UTF-8
strings in `ERB::Util.unwrapped_html_escape` and `ERB::Util.html_escape_once`.
Prevents user-entered input passed from a querystring into a form field from
causing invalid byte sequence errors.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
We use one period after spaces, not two.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Collection input propagates input's id to the label's for attribute.
|
| | | | | | | | |
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
Use Module.prepend instead of alias_method and unify behavior of all Numeric extensions
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
alias_method
|
|\ \ \ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
Allow select using Arel and perform a count
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
It allows a query like `User.select(:name).count` to be written
using Arel as `User.select(User.arel_table[:name]).count`.
It exposes the calculations API to accept Arel nodes:
`User.count(User.arel_table[:name])`, `User.sum(User.arel_table[:id])`,
`Account.average(Account.arel_table[:credit_limit])`,
`Account.maximum(Account.arel_table[:credit_limit])` and
`Account.minimum(Account.arel_table[:credit_limit])`.
|
|\ \ \ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
Set active_record config for always creating uuids in generators
|