aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/CHANGELOG.md
Commit message (Collapse)AuthorAgeFilesLines
* Undeprecate the :extend optionJon Leighton2013-01-181-1/+0
| | | | | | | Suggested by @dhh. It doesn't affect the generated SQL, so seems reasonable to continue to allow it as an association option.
* `CollectionAssociation#empty?` respects newly builded recordsYves Senn2013-01-131-0/+11
|
* Add CHANGELOG entry for YAML parsing removalPrem Sichanugrist2013-01-081-1/+5
| | | | This is for commit e80546cdec56a9c3fcaf6217cba08a02d789d2bc.
* Fix error when assigning NaN to an integer columnTristan Harward2013-01-061-4/+5
| | | | | | | | | Also covers any non-castable case by returning nil, which is in-line with the intention of the former implementation, but covers the odd cases which respond to to_i but raise an error when it's called, such as NaN, Infinity and -Infinity. Fixes #8757
* Move changelog entry in railties to the topCarlos Antonio da Silva2013-01-041-2/+2
| | | | Other minor changelog improvements [ci skip]
* Support for PostgreSQL's ltree data type.Rob Worley2013-01-041-0/+4
|
* Fix undefined method `to_i' introduced since 3.2.8Jason Stirk2013-01-041-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit fixes a bug introduced in 96a13fc7 which breaks behaviour of integer fields. In 3.2.8, setting the value of an integer field to a non-integer (eg. Array, Hash, etc.) would default to 1 (true) : # 3.2.8 p = Post.new p.category_id = [ 1, 2 ] p.category_id # => 1 p.category_id = { 3 => 4 } p.category_id # => 1 In 3.2.9 and above, this will raise a NoMethodError : # 3.2.9 p = Post.new p.category_id = [ 1, 2 ] NoMethodError: undefined method `to_i' for [1, 2]:Array Whilst at first blush this appear to be sensible, it combines in bad ways with scoping. For example, it is common to use scopes to control access to data : @collection = Posts.where(:category_id => [ 1, 2 ]) @new_post = @collection.new In 3.2.8, this would work as expected, creating a new Post object (albeit with @new_post.category_id = 1). However, in 3.2.9 this will cause the NoMethodError to be raised as above. It is difficult to avoid triggering this error without descoping before calling .new, breaking any apps running on 3.2.8 that rely on this behaviour. This patch deviates from 3.2.8 in that it does not retain the somewhat spurious behaviour of setting the attribute to 1. Instead, it explicitly sets these invalid values to nil : p = Post.new p.category_id = [ 1, 2 ] p.category_id # => nil This also fixes the situation where a scope using an array will "pollute" any newly instantiated records. @new_post = @collection.new @new_post.category_id # => nil Finally, 3.2.8 exhibited a behaviour where setting an object to an integer field caused it to be coerced to "1". This has not been retained, as it is spurious and surprising in the same way that setting Arrays and Heshes was : c = Category.find(6) p = Post.new # 3.2.8 p.category_id = c p.category_id # => 1 # This patch p.category_id = c p.category_id # => nil This commit includes explicit test cases that expose the original issue with calling new on a scope that uses an Array. As this is a common situation, an explicit test case is the best way to prevent regressions in the future. It also updates and separates existing tests to be explicit about the situation that is being tested (eg. AR objects vs. other objects vs. non-integers)
* Merge pull request #8705 from amparo-luna/change_update_attributes_to_updateGuillermo Iguaran2013-01-031-0/+7
|\ | | | | Rename update_attributes method to update
| * Add Changelog entry regarding update_attibutes being renamed to updateAmparo Luna + Guillermo Iguaran2013-01-031-0/+7
| |
* | Changelog improvements [ci skip]Carlos Antonio da Silva2013-01-021-1/+2
|/
* Fix CHANGELOG style [ci skip]Rafael Mendonça França2012-12-261-5/+5
|
* validate :on option on after_commit and after_rollback callbacksPascal Friederich2012-12-261-0/+5
|
* Update Migration and 4.0 Release Guides, Changelogs [#8267]Marc-Andre Lafortune2012-12-211-0/+17
|
* Serialized attribute can be serialized in an integer columnRafael Mendonça França2012-12-211-2/+7
| | | | Fix #8575
* Fix Action Mailer changelog indenation to match other changelogsCarlos Antonio da Silva2012-12-191-1/+1
| | | | Also some minor improvements to other changelogs. [ci skip]
* Keep index names when using with sqlite3Yves Senn2012-12-191-0/+5
|
* #5523 Add ability for postgresql adapter to disable user triggers in ↵Gary S. Weaver2012-12-181-0/+5
| | | | disable_referential_integrity.
* Added support for validates_uniqueness_of in PostgreSQL array columns. ↵Pedro Padron2012-12-181-0/+5
| | | | Fixes: #8075.
* AR supporting new intrange data type on PostgreSQL >= 9.2Alexey2012-12-161-0/+4
|
* Convert changelogs to 1.9 hash style and fix some formatting [ci skip]Carlos Antonio da Silva2012-12-141-5/+5
|
* Do not log the binding values for binary columns.Matthew M. Boedicker2012-12-141-0/+4
| | | | They tend to be large and not very useful in the log.
* Fix for has_many_through counter_cache bugMatthew Robertson2012-12-141-0/+5
| | | | | | This commit fixes reported issue #7630 in which counter caches were not being updated properly when replacing has_many_through relationships
* recognize migrations, in folders containing numbers and 'rb'.Yves Senn2012-12-131-0/+5
| | | | Closes #8492
* Remove changelog entry from #8441 [ci skip]Carlos Antonio da Silva2012-12-111-4/+0
| | | | | | | This issue only happens on master due to internal AR refactorings, so there is no need for a changelog entry. The test was backported to 3-2-stable to ensure there won't be any regressions.
* Add CHANGELOG entry for #6376.Rafael Mendonça França2012-12-101-0/+4
| | | | | Conflicts: activerecord/CHANGELOG.md
* Allow users to choose the timestamp format in the cache keyRafael Mendonça França2012-12-101-0/+7
| | | | | | | This can be done using the class attribute cache_timestamp_format Conflicts: railties/guides/source/configuring.textile
* Fix decorating columns for serialized attributesitzki2012-12-101-0/+4
|
* Move to the schema-migrations-metadata branch.Jeremy Kemper2012-12-091-16/+0
| | | | | | | | | | | | | | | | | | | | | | | | Pending work on graceful app upgrades. Revert "Merge pull request #8439 from joshsusser/fixes" This reverts commit ce8ac39338f86388e70356b3a470b3ea443802ae, reversing changes made to b0e7b6f67c984d4b1502e801781ed75fad681633. Revert "Merge pull request #8431 from joshsusser/schemadump" This reverts commit 036d3e1c2b65c4b8cbd23de2e20ad67b9b756182, reversing changes made to 0c692f4d121792117b6a71e5ed590a31c3b9d12e. Revert "Merge branch 'joshsusser-master' into merge" This reverts commit 0c692f4d121792117b6a71e5ed590a31c3b9d12e, reversing changes made to 2e299fca715b083a60222a85e48f9d3b8dd8ce93. Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb activerecord/test/cases/schema_dumper_test.rb
* Session variables for mysql, mysql2, and postgresql adapters can be setAaron Stone2012-12-081-0/+8
| | | | | | | | | in the new 'variables:' hash in each database config section in database.yml. The key-value pairs of this hash will be sent in a 'SET key = value, ...' query on new database connections. The configure_connection methods from mysql and mysql2 into are consolidated into the abstract_mysql base class.
* Update AR Changelog with correct example using includesCaike Souza2012-12-081-4/+4
| | | | These queries don't seem to work without the includes clause. [ci skip]
* Rollback where.like and where.not_likeCarlos Antonio da Silva2012-12-071-3/+2
| | | | | | | | | | | | | | | | | | | The real win with these chain methods is where.not, that takes care of different scenarios in a graceful way, for instance when the given value is nil. where("author.id != ?", author_to_ignore.id) where.not("author.id", author_to_ignore.id) Both where.like and where.not_like compared to the SQL versions doesn't seem to give us that much: Post.where("title LIKE 'ruby on%'") Post.where.like(title: 'ruby on%'") Post.where("title NOT LIKE 'ruby on%'") Post.where.not_like(title: 'ruby on%'") Thus Rails is adding where.not, but not where.like/not_like and others.
* Merge pull request #8332 from amatsuda/ar_where_chainCarlos Antonio da Silva2012-12-071-0/+9
|\ | | | | | | | | | | | | | | Relation.where with no args can be chained with not, like, and not_like Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/relation/query_methods.rb
| * Relation.where with no args can be chained with not, like, and not_likeAkira Matsuda2012-11-301-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | examples: Model.where.not field: nil #=> "SELECT * FROM models WHERE field IS NOT NULL Model.where.like name: 'Jeremy%' #=> "SELECT * FROM models WHERE name LIKE 'Jeremy%' this feature was originally suggested by Jeremy Kemper https://github.com/rails/rails/pull/5950#issuecomment-5591330 Closes #5950
* | Unscope update_column(s) query to ignore default scopeCarlos Antonio da Silva2012-12-061-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When applying default_scope to a class with a where clause, using update_column(s) could generate a query that would not properly update the record due to the where clause from the default_scope being applied to the update query. class User < ActiveRecord::Base default_scope where(active: true) end user = User.first user.active = false user.save! user.update_column(:active, true) # => false In this situation we want to skip the default_scope clause and just update the record based on the primary key. With this change: user.update_column(:active, true) # => true Fixes #8436.
* | Improve AR changelogCarlos Antonio da Silva2012-12-061-18/+17
| |
* | CHANGELOG for 78d5d6f.Steve Klabnik2012-12-061-0/+3
| | | | | | | | | | It was pointed out by @giner that the CHANGELOG entry for https://github.com/rails/rails/commit/78d5d6f8688bb7c45ba9a3ef893682231130da3f wasn't included. Here it is.
* | Merge branch 'joshsusser-master' into mergeAaron Patterson2012-12-051-0/+18
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * joshsusser-master: style cleanup Add migration history to schema.rb dump Add metadata to schema_migrations Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/schema.rb
| * | Add migration history to schema.rb dumpJosh Susser2012-12-021-0/+11
| | |
| * | Add metadata to schema_migrationsJosh Susser2012-12-011-0/+7
| | | | | | | | | | | | | | | migrated_at: timestamp when migration run fingerprint: md5 hash of migration source name: filename without version or extension
* | | Replace comments' non-breaking spaces with spacesclaudiob2012-12-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes, on Mac OS X, programmers accidentally press Option+Space rather than just Space and don’t see the difference. The problem is that Option+Space writes a non-breaking space (0XA0) rather than a normal space (0x20). This commit removes all the non-breaking spaces inadvertently introduced in the comments of the code.
* | | Fix #8414. Performance problem with postgresql adapter primary_key function.kennyj2012-12-051-0/+6
| | |
* | | Do not instantiate intermediate AR objects when eager loading.Yves Senn2012-12-041-0/+6
|/ / | | | | | | Closes #3313
* | Added STI support to init and building associationsJason Rush2012-11-291-0/+9
| | | | | | | | | | | | | | | | Allows you to do BaseClass.new(:type => "SubClass") as well as parent.children.build(:type => "SubClass") or parent.build_child to initialize an STI subclass. Ensures that the class name is a valid class and that it is in the ancestors of the super class that the association is expecting.
* | Add CHANGELOG entries for the observes extractionRafael Mendonça França2012-11-291-0/+4
| | | | | | | | [ci skip]
* | Ensure that associations have a symbol argument.Steve Klabnik2012-11-281-0/+2
| | | | | | | | Fixes #7418.
* | Use assert_nil instead of assert_equalRafael Mendonça França2012-11-281-1/+1
|/
* Don't call will_change! for datetime nil->"".Alisdair McDiarmid2012-11-251-0/+6
| | | | | | | Setting a nil datetime attribute to a blank string should not cause the attribute to be dirty. Fix #8310
* Fix changelog entry about fast_string_to_time fixCarlos Antonio da Silva2012-11-241-2/+2
| | | | | Introduced in 53ca22f2e11cd3050d75385bc31b6bb5055a2738. Thanks @rochefort. [ci skip]
* Merge pull request #8291 from senny/8265_build_with_polymorphic_associationRafael Mendonça França2012-11-221-0/+5
|\ | | | | | | | | | | | | prevent mass assignment of polymorphic type when using `build` Conflicts: activerecord/CHANGELOG.md
| * prevent mass assignment of polymorphic type when using `build`Yves Senn2012-11-221-0/+5
| | | | | | | | Closes #8265