aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* docs, refactor docs about column modifiers. [ci skip] [Matthew Draper & Yves ↵Yves Senn2014-06-101-12/+20
| | | | | | | | | | | | | | | | | | | | Senn] This is a follow up to #15602 which rendered the guides in a weird state: > You can also specify some options just after the field type between curly braces. You can use the following modifiers: > `null` Allows or disallows `NULL` values in the column. > NOTE: `null` and `default` cannot be specified via command line. The modifiers are now moved into a separate section. The generator simply referes to that section. Related to #15583. /cc @JuanitoFatas
* Merge pull request #15604 from JuanitoFatas/doc/migrationXavier Noria2014-06-102-2/+2
|\ | | | | [ci skip] Rename: Rails Database Migration to Active Record Migration.
| * [ci skip] Rename: Rails Database Migration to Active Record Migration.Juanito Fatas2014-06-102-2/+2
|/ | | | This will need to setup permanent redirect for the old guide.
* Merge pull request #15584 from jamesyang124/issue_15382Yves Senn2014-06-103-1/+19
|\ | | | | | | | | | | | | | | ActiveRecord::FinderMethods.find doesn't pass proc parameter to array Manual merge of #15584. Closes #15584.
| * ActiveRecord::FinderMethods.find passes proc parameter #15382James Yang2014-06-103-1/+19
|/
* Merge pull request #15602 from JuanitoFatas/doc/type-modifierYves Senn2014-06-101-0/+2
|\ | | | | [ci skip] Add note about type modifiers that cannot be specified in command line.
| * [ci skip] Add note about type modifiers that cannot be specified in command ↵Juanito Fatas2014-06-101-0/+2
|/ | | | line.
* Merge pull request #15599 from arthurnn/HABTMAssociationRafael Mendonça França2014-06-102-2/+2
|\ | | | | Use HasAndBelongsToMany instead of HABTM
| * Use HasAndBelongsToMany instead of HABTMArthur Neves2014-06-092-2/+2
|/
* Merge pull request #15597 from eileencodes/reuse-available-collection-methodsRafael Mendonça França2014-06-093-5/+5
|\ | | | | reuse available collection? check instead of macro
| * reuse available collection? check instead of macroeileencodes2014-06-093-5/+5
|/ | | | | | | Reflection has an available method that is used to check if the reflection is a collection. Any :has_many macro is considered a collection and `collection?` should be used instead of `macro == :has_many`.
* Merge pull request #15596 from eileencodes/add-has_one-method-and-reuseRafael Mendonça França2014-06-095-5/+9
|\ | | | | add has_one? method and reuse instead of checking macro
| * add has_one? method and reuse instead of checking macroeileencodes2014-06-095-5/+9
| | | | | | | | | | | | Instead of checking for `macro == :has_one` throughout the codebase we can create a `has_one?` method to match the `belongs_to?`, `polymorphic?` and other methods.
* | Merge pull request #15595 from eileencodes/abstract-away-habtm-macroAaron Patterson2014-06-092-2/+9
|\ \ | |/ |/| Abstract away use of HABTM macro
| * Abstract away use of HABTM macroeileencodes2014-06-092-2/+9
| | | | | | | | | | | | | | | | | | By having the `:has_and_belongs_to_many` macro in the `@collection` we are punishing `:has_many` associations because it has to allocate the array and check the macro. @collection is returned to `macro == :has_many` and a new reflection class `HABTMReflection` is created to handle this case instead.
* | Fix bug that make HashWithIndifferentAccess work differently of HashRafael Mendonça França2014-06-092-1/+9
| | | | | | | | | | Before HashWithIndifferentAccess were doing deep_dup of the inner hashes when Hash doesn't do. Now both are behaving in the same way.
* | Timestamp values should be present on callbacksRafael Mendonça França2014-06-094-23/+15
| | | | | | | | | | | | | | This reverts commit dd3ea17191e316aeebddaa7b176f6cfeee7a6365 and add a regression test. Fixes #15418
* | Merge pull request #15592 from sgrif/sg-type-cast-from-databaseRafael Mendonça França2014-06-0926-132/+135
|\ \ | | | | | | Rename `type_cast` to `type_cast_from_database`
| * | Rename `type_cast` to `type_cast_from_database`Sean Griffin2014-06-0926-132/+135
|/ / | | | | | | | | | | | | | | In some cases there is a difference between the two, we should always be doing one or the other. For convenience, `type_cast` is still a private method on type, so new types that do not need different behavior don't need to implement two methods, but it has been moved to private so it cannot be used accidentally.
* | Merge pull request #15586 from sgrif/sg-identity-typeRafael Mendonça França2014-06-091-1/+1
|\ \ | | | | | | Use an actual identity type in AR::Result#identity_type
| * | Use an actual identity type in AR::Result#identity_typeSean Griffin2014-06-091-1/+1
| | | | | | | | | | | | | | | We should be able to rely on this object implenting the full type interface.
* | | Merge pull request #15587 from sgrif/sg-remove-workaroundRafael Mendonça França2014-06-091-15/+8
|\ \ \ | | | | | | | | Remove workaround for non-lazy serialize in tests
| * | | Remove workaround for non-lazy serialize in testsSean Griffin2014-06-091-15/+8
| | | | | | | | | | | | | | | | `serialize` is now lazy, so the workaround is no longer needed.
* | | | Merge pull request #15591 from sgrif/sg-rm-write-attributeRafael Mendonça França2014-06-0915-64/+64
|\ \ \ \ | | | | | | | | | | Make `_before_type_cast` actually be before type cast
| * | | | Make `_before_type_cast` actually be before type castSean Griffin2014-06-0915-64/+64
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - The following is now true for all types, all the time - `model.attribute_before_type_cast == given_value` - `model.attribute == model.save_and_reload.attribute` - `model.attribute == model.dup.attribute` - `model.attribute == YAML.load(YAML.dump(model)).attribute` - Removes the remaining types implementing `type_cast_for_write` - Simplifies the implementation of time zone aware attributes - Brings tz aware attributes closer to being implemented as an attribute decorator - Adds additional point of control for custom types
* | | / Do not try to set the foreign_key again on has_many throughRafael Mendonça França2014-06-091-1/+1
| |_|/ |/| | | | | | | | | | | | | | | | | Integration tests are inside protected_attributes test suite. Fixes #15496 Fixes rails/protected_attributes#35
* | | Merge pull request #15588 from thedarkone/remove-has-one-order-optionRafael Mendonça França2014-06-091-1/+1
|\ \ \ | |/ / |/| | Remove a long gone :order option from has_one's valid_options
| * | Remove a long gone :order option from has_one's valid_options.thedarkone2014-06-091-1/+1
|/ /
* / pg guide, add index to PostgreSQL array example. [ci skip]Yves Senn2014-06-091-1/+3
|/
* Merge pull request #15573 from bf4/mail_2_6_1_releasedRafael Mendonça França2014-06-081-1/+0
|\ | | | | Mail 2.6.1 silences excessive warnings; remove Gemfile hack
| * Mail 2.6.1 silences excessive warnings; remove Gemfile hackBenjamin Fleischer2014-06-081-1/+0
|/ | | | | | | | Completes https://github.com/rails/rails/pull/15493 Revert "For our build, stick with mail 2.5.x for now" This reverts commit b8f586a094c104006d29a87fee0d8b48d0af2d14.
* Merge pull request #15571 from kalmanh/patch-1Richard Schneeman2014-06-081-0/+1
|\ | | | | Update migrations.md
| * Update migrations.mdKalman Hazins2014-06-081-0/+1
|/ | | default column type modifier
* Ignore distressingly-frequent segfaults on this buildMatthew Draper2014-06-081-0/+2
| | | | | | | Not sure what's causing them suddenly, but it seems unlikely there's much we can do about it. For the small amount of coverage this particular job gains us, it's hurting us more, by making CI failures unremarkable.
* Merge pull request #15545 from zuhao/refactor_actionpack_assert_select_testYves Senn2014-06-081-1/+4
|\ | | | | Restore test deliveries for ActionMailer.
| * Restore test deliveries for ActionMailer.Zuhao Wan2014-06-071-1/+4
| |
* | Merge pull request #15452 from matthewd/live-abortMatthew Draper2014-06-084-13/+189
|\ \ | | | | | | Handle client disconnect during live streaming
| * | Handle client disconnect during live streamingMatthew Draper2014-06-084-13/+189
| | | | | | | | | | | | .. even when the producer is blocked for a write.
* | | Merge pull request #15567 from aditya-kapoor/add-casesRafael Mendonça França2014-06-071-0/+11
|\ \ \ | | | | | | | | Add Additional Test Cases for the constantize
| * | | Add Missing Test Cases for the constantizeAditya Kapoor2014-06-071-0/+11
| |/ /
* | | Merge pull request #15566 from kuldeepaggarwal/fix-buildRafael Mendonça França2014-06-071-3/+3
|\ \ \ | | | | | | | | fix test cases after #15558 merge to master.
| * | | fix test cases after #15558 merge to master.Kuldeep Aggarwal2014-06-071-3/+3
|/ / /
* | | Merge pull request #15558 from sgrif/sg-rename-propertyRafael Mendonça França2014-06-077-25/+25
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename `property` to `attribute` Conflicts: activerecord/lib/active_record/attribute_methods/serialization.rb activerecord/lib/active_record/base.rb
| * | | Rename `property` to `attribute`Sean Griffin2014-06-078-26/+26
| | | | | | | | | | | | | | | | For consistency with https://github.com/rails/rails/pull/15557
* | | | Merge pull request #15546 from sgrif/sg-lazy-decoratorsRafael Mendonça França2014-06-077-16/+179
|\ \ \ \ | |_|/ / |/| | | Don't query the database schema when calling `serialize`
| * | | Don't query the database schema when calling `serialize`Sean Griffin2014-06-077-16/+179
| | |/ | |/| | | | | | | | | | | | | We need to decorate the types lazily. This is extracted to a separate API, as there are other refactorings that will be able to make use of it, and to allow unit testing the finer points more granularly.
* | | Merge pull request #15561 from sgrif/sg-time-zone-aware-arraysRafael Mendonça França2014-06-072-1/+13
|\ \ \ | | | | | | | | Ensure time zones don't change after round trip with array columns
| * | | Ensure time zones don't change after round trip with array columnsSean Griffin2014-06-072-1/+13
| | | | | | | | | | | | | | | | | | | | The times would be equivalent, even if they were in different time zones. E.g. 12:00 UTC == 5:00 PDT
* | | | Merge pull request #15562 from sgrif/sg-double-type-cast-dirtyRafael Mendonça França2014-06-075-25/+27
|\ \ \ \ | | | | | | | | | | Do not type cast twice on attribute assignment
| * | | | Do not type cast twice on attribute assignmentSean Griffin2014-06-075-25/+27
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The definition of `write_attribute` in dirty checking ultimately leads to the columns calling `type_cast` on the value to perform the comparison. However, this is a potentially expensive computation that we cache when it occurs in `read_attribute`. The only case that we need the non-type-cast form is for numeric, so we pass that through as well (something I'm looking to remove in the future). This also reduces the number of places that manually access various stages in an attribute's type casting lifecycle, which will aid in one of the larger refactorings that I'm working on.