aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Change Integer#year to return a Fixnum instead of a Float to improve consistencyKonstantinos Rousis2015-10-223-3/+19
|
* Merge pull request #21950 from ↵Andrew White2015-10-224-11/+17
|\ | | | | | | | | rafaelsales/issues/21922-fix-ar-group-by-attribute-lookup Fix generated projection fields in group by query
| * Refactor Calculations#execute_grouped_calculation and clean AR test caseRafael Sales2015-10-222-11/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | * 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
| * Fix generated projection fields in group by queryRafael Sales2015-10-223-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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" ```
* | Merge pull request #22011 from kamipo/remove_unused_args_againAndrew White2015-10-224-24/+14
|\ \ | |/ |/| Remove `#tables` extra args again
| * Remove `#tables` extra args againRyuta Kamizono2015-10-224-24/+14
|/ | | | | | 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.
* Merge pull request #22019 from timoschilling/patch-2Sean Griffin2015-10-211-1/+0
|\ | | | | remove unnecessary forwardable require
| * remove unnecessary forwardable requireTimo Schilling2015-10-211-1/+0
|/ | | `Forwardable` has been used in the past
* Merge pull request #22018 from jbranchaud/move-getter-to-attr-readerAndrew White2015-10-211-5/+1
|\ | | | | Extract native getter to attr_reader.
| * Extract native getter to attr_reader.jbranchaud2015-10-211-5/+1
| | | | | | | | | | The getter is doing nothing more than returning the ivar, so it can be extracted to an attr_reader.
* | Merge pull request #20026 from rails/remove-possible-singleton-methodAndrew White2015-10-213-4/+32
|\ \ | |/ |/| Fix warnings in multiple application tests
| * Add Module#remove_possible_singleton_methodAndrew White2015-10-213-4/+32
|/ | | | | This is primarily to fix method redefinition warnings in class_attribute but may be of use in other places where we define singleton methods.
* move documentation of column options to `add_column`. Closes #20400.Yves Senn2015-10-212-79/+81
| | | | | | | | | | | | [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`.
* Merge pull request #22013 from NelsonScott/patch-1Yves Senn2015-10-211-1/+1
|\ | | | | typo
| * typoScott Nelson2015-10-201-1/+1
|/
* Really fix test failures caused by #19851Sean Griffin2015-10-201-5/+6
| | | | | | | 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
* Fix test failures caused by #19851Sean Griffin2015-10-201-5/+5
| | | | | | | | | 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.
* Merge pull request #22008 from rails/revert-19898-common-secretsSean Griffin2015-10-201-16/+0
|\ | | | | Revert " Added an example to show how common secrets can be shared ac…
| * Revert " Added an example to show how common secrets can be shared across ↵Sean Griffin2015-10-201-16/+0
|/ | | | multiple environments in secrets.yml"
* Merge pull request #19851 from repinel/numericality-validation2Sean Griffin2015-10-202-13/+47
|\ | | | | Use the post-type-cast version of the attribute to validate numericality
| * Conditionally convert the raw_value received by the numeric validator.Roque Pinel2015-07-112-13/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]
* | Merge pull request #19889 from cedrics/long-uri-encoded-keysSean Griffin2015-10-202-3/+9
|\ \ | | | | | | FileStore: Long cache keys may result in too long paths due to encoding
| * | when checking for too long cache keys used the uri encoded fname Cedric Sohrauer2015-04-242-3/+9
| | |
* | | Merge pull request #19898 from prathamesh-sonpatki/common-secretsSean Griffin2015-10-201-0/+16
|\ \ \ | | | | | | | | Added an example to show how common secrets can be shared across multiple environments in secrets.yml [ci skip]
| * | | Added example of sharing secrets in multiple environments in secrets.ymlPrathamesh Sonpatki2015-05-261-0/+16
| | | |
* | | | Merge pull request #19938 from vngrs/join_dependency_instantiate_bugSean Griffin2015-10-206-6/+29
|\ \ \ \ | | | | | | | | | | | | | | | Fix for activerecord join dependency instantiate bug
| * | | | Fix merge conflicts for #19938Sean Griffin2015-10-206-6/+29
|/| | | | | | | | | | | | | | | | | | | | | | | | This is a separate commit, as it is not just a changelog conflict. Want to point out the changes in the code
| * | | | Fix for activerecord join dependency instantiate bugMehmet Emin İNAÇ2015-05-046-6/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | use only object_id instead parent class and parent id test cases assert_equal use table name in references fix minor problems
* | | | | Merge pull request #19992 from greysteil/handle-invalid-utf8-in-html-escapeSean Griffin2015-10-203-4/+19
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | Handle invalid UTF-8 strings when HTML escaping
| * | | | | Handle invalid UTF-8 strings when HTML escapingGrey Baker2015-06-083-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | Fix minor typo from #20038Sean Griffin2015-10-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | We use one period after spaces, not two.
* | | | | | Merge pull request #20482 from nashby/collection-label-forSean Griffin2015-10-200-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | Collection input propagates input's id to the label's for attribute.
* | | | | | Collection check boxes propagates input's id to the label's for attribute.Vasiliy Ermolovich2015-10-203-0/+18
| | | | | |
* | | | | | Merge pull request #20038 from imanel/numeric_prependSean Griffin2015-10-203-44/+22
|\ \ \ \ \ \ | | | | | | | | | | | | | | Use Module.prepend instead of alias_method and unify behavior of all Numeric extensions
| * | | | | | Unify behavior of all Numeric extensions and use Module.prepend instead of ↵Bernard Potocki2015-05-283-44/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | alias_method
* | | | | | | Merge pull request #20653 from repinel/allow-arel-select-countSean Griffin2015-10-202-1/+55
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Allow select using Arel and perform a count
| * | | | | | | Allow select with Arel and count as well as calculations with ArelRoque Pinel2015-06-302-1/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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])`.
* | | | | | | | Merge pull request #21762 from jmccartie/jm/uuidSean Griffin2015-10-204-1/+26
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | Set active_record config for always creating uuids in generators
| * | | | | | | | Set active_record config for always creating uuids in generatorsJon McCartie2015-10-204-1/+26
| | | | | | | | |
* | | | | | | | | Merge pull request #20715 from simsalabim/feature/parse-rss-atom-as-xmlSean Griffin2015-10-203-14/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | parse RSS/ATOM responses as XML, not HTML
* | | | | | | | | Merge pull request #20737 from gouravtiwari/multibyte_chars_slice_fixSean Griffin2015-10-203-2/+23
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed multibyte-chars slice! behavior to return nil for out-of-bound parameters
| * | | | | | | | | Update #20737 to address feedbackSean Griffin2015-10-203-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given that this pull request affects a mutable value, we need to test for and document the affects on the receiver in this case. Additionally, this pull request was missing a CHANGELOG entry.
| * | | | | | | | | Fixed slice! behavior: return nil for out-of-bound parametersGourav Tiwari2015-10-202-1/+6
|/ / / / / / / / /
* | | | | | | | | Merge pull request #20768 from ↵Sean Griffin2015-10-201-1/+3
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vrybas/guides-clarify-belongs-to-required-by-default [Rails Guides] clarify `belongs_to_required_by_default` option [ci skip]
| * | | | | | | | | Update #20768 to address feedbackSean Griffin2015-10-201-3/+3
| | | | | | | | | |
| * | | | | | | | | [Rails Guides] Clarify `belongs_to_required_by_default` optionVladimir Rybas2015-10-201-1/+3
|/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Original: * `config.active_record.belongs_to_required_by_default` is a boolean value and controls whether `belongs_to` association is required by default. Modified version: * `config.active_record.belongs_to_required_by_default` is a boolean value and controls whether validation error is triggered by default if `belongs_to` association is not present or not valid.
* | | | | | | | | Merge pull request #20795 from benjiwheeler/validation_guide_ret_valSean Griffin2015-10-201-7/+15
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | activerecord guide: clarified roles of valid method and errors object [ci skip]
| * | | | | | | | | activerecord guide: clarified roles of valid method and errors object [ci skip]Ben Wheeler2015-07-081-7/+15
| | | | | | | | | |
* | | | | | | | | | Merge pull request #20872 from maxjacobson/more-humane-roundingSean Griffin2015-10-203-2/+11
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Round some numbers more humanely
| * | | | | | | | | | Update the changelog for #20872 to be a bit less confusingSean Griffin2015-10-201-2/+2
| | | | | | | | | | |