aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/CHANGELOG.md
Commit message (Collapse)AuthorAgeFilesLines
* 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
* 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
* | Deprecate Relation#sum with a block.Carlos Antonio da Silva2012-11-211-0/+5
| | | | | | | | | | | | | | To perform a sum calculation over the array of elements, use to_a.sum(&block). Please check the discussion in f9cb645dfcb5cc89f59d2f8b58a019486c828c73 for more context.
* | Revert "Yield only one argument instead of splatting."Carlos Antonio da Silva2012-11-211-7/+0
|/ | | | | | | | | | | | | | This reverts commit f9cb645dfcb5cc89f59d2f8b58a019486c828c73. Conflicts: activerecord/CHANGELOG.md Revert "Allow blocks for count with ActiveRecord::Relation. Document and test that sum allows blocks" This reverts commit 9cc2bf69ce296b7351dc612a8366193390a305f3. Conflicts: activerecord/lib/active_record/relation/calculations.rb
* Fix postgresql adapter to handle bc timestamps correctlyBogdan Gusiev2012-11-211-0/+6
|
* Postgresql doesn't accepts limits on text columns.Victor Costan2012-11-201-0/+5
|
* Merge pull request #3023 from Tho85/preserve_sti_typeRafael Mendonça França2012-11-181-0/+7
|\ | | | | | | | | | | | | AR::Base.becomes should not change the STI type Conflicts: activerecord/CHANGELOG.md
| * AR::Base.becomes should not change the STI typeThomas Hollstegge2012-11-171-0/+7
| | | | | | | | If you want to change the STI type too, use AR::Base.becomes! instead
* | Add rename_index to change_table.Jarek Radosz2012-11-191-0/+8
|/
* Fix some AR changelog entries [ci skip]Carlos Antonio da Silva2012-11-161-6/+5
|
* `#pluck` can be used on a relation with `select` clause.Yves Senn2012-11-121-0/+9
| | | | Closes #7551
* cleanup, removed whitespace from CHANGELOGYves Senn2012-11-121-1/+1
|
* Do not create useless database transaction when building `has_one` association.Bogdan Gusiev2012-11-101-0/+9
|
* :counter_cache option for to support custom named counter caches. Closes #7993Yves Senn2012-11-041-0/+5
|
* Deprecate passing a string as third argument of `add_index`Rafael Mendonça França2012-11-021-0/+7
| | | | | | | This was there due historical reasons since 7dc45818dc43c163700efc9896a0f3feafa31138 to give the user the possibility to create unique indexes passing "UNIQUE" as the third argument
* Raise an ArgumentError when passing an invalid option to add_indexRafael Mendonça França2012-11-021-0/+4
| | | | Closes #8104
* Fix find_in_batches against string IDs when start option is not specified.Alexis Bernard2012-10-311-0/+4
|
* Fix `attributes_before_type_cast` for serialised attributes.Nikita Afanasenko2012-10-311-0/+4
| | | | Public method `attributes_before_type_cast` used to return internal AR structure (ActiveRecord::AttributeMethods::Serialization::Attribute), patch fixes this. Now behaves like `read_attribute_before_type_cast` and returns unserialised values.
* Fix #6951. Use query cache/uncache, when using not only database.yml but ↵kennyj2012-10-311-0/+5
| | | | also DATABASE_URL.
* ActiveRecord::Relation#none! method.Juanjo Bazán2012-10-281-0/+5
|
* Enable update_column(s) for the primary key attribute.Henrik N2012-10-281-0/+4
| | | | Didn't work before because it updated the model-in-memory first, so the DB query couldn't find the record.
* raise `ArgumentError` when redefining the primary key column. Closes #6378Yves Senn2012-10-281-0/+5
|
* AR::AttributeMethods#[] raises AM::AttributeMissingError for missing attributes.Francesco Rodriguez2012-10-281-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | This fixes the following behaviour: class Person < ActiveRecord::Base belongs_to :company end # Before: person = Person.select('id').first person[:name] # => nil person.name # => ActiveModel::MissingAttributeError: missing_attribute: name person[:company_id] # => nil person.company # => nil # After: person = Person.select('id').first person[:name] # => ActiveModel::MissingAttributeError: missing_attribute: name person.name # => ActiveModel::MissingAttributeError: missing_attribute: name person[:company_id] # => ActiveModel::MissingAttributeError: missing_attribute: company_id person.company # => ActiveModel::MissingAttributeError: missing_attribute: company_id Fixes #5433.
* Use the MySQL varbinary type when appropriate in migrations.Victor Costan2012-10-271-0/+4
|
* Decode attributes pulled from URI.parseShawn Veader2012-10-261-1/+5
| | | | | | | The RFC indicates that username and passwords may be encoded. http://tools.ietf.org/html/rfc2396#section-3.2.2 Found this trying to use the mysql://username:password@host:port/db and having special characters in the password which needed to be URI encoded.
* Remove ActiveRecord::ModelJon Leighton2012-10-261-28/+0
| | | | | | | | | | In the end I think the pain of implementing this seamlessly was not worth the gain provided. The intention was that it would allow plain ruby objects that might not live in your main application to be subclassed and have persistence mixed in. But I've decided that the benefit of doing that is not worth the amount of complexity that the implementation introduced.
* Fix incorrect markdown by removing extra space.Uģis Ozols2012-10-241-1/+1
|
* Revert "Get rid of the ActiveRecord::Model::DeprecationProxy thing."Jeremy Kemper2012-10-201-8/+1
| | | | This reverts commit 83846838252397b3781eed165ca301e05db39293.
* Get rid of the ActiveRecord::Model::DeprecationProxy thing.Jon Leighton2012-10-191-1/+8
| | | | | | | | | | | | | | | | | I think it's going to be too much pain to try to transition the :active_record load hook from executing against Base to executing against Model. For example, after Model is included in Base, and modules included in Model will no longer get added to the ancestors of Base. So plugins which wish to be compatible with both Model and Base should use the :active_record_model load hook which executes *before* Base gets loaded. In general, ActiveRecord::Model is an advanced feature at the moment and probably most people will continue to inherit from ActiveRecord::Base for the time being.
* Rename the partial_updates config to partial_writesJon Leighton2012-10-191-0/+4
| | | | This reflects the fact that it now impact inserts as well as updates.
* nodoc the first_or_create methods and document alternativesJon Leighton2012-10-191-3/+11
|
* Add Relation#find_or_create_by and friendsJon Leighton2012-10-191-2/+32
| | | | | | | This is similar to #first_or_create, but slightly different and a nicer API. See the CHANGELOG/docs in the commit. Fixes #7853
* Fix bug with presence validation of associations.Scott Willson2012-10-161-0/+5
| | | | Would incorrectly add duplicated errors when the association was blank. Bug introduced in 1fab518c6a75dac5773654646eb724a59741bc13.
* Merge pull request #7371 from csmuc/fix_dup_validation_errorsSantiago Pastorino2012-10-161-0/+5
|\ | | | | Dup'ed ActiveRecord objects may not share the errors object
| * Call super to nullify the reference to the original errors object in the ↵Christian Seiler2012-10-161-0/+5
| | | | | | | | dup'ed object (call ActiveModel::Validations#initialize_dup). Closes #7291
* | Move changelog entry from #7439 to the top [ci skip]Carlos Antonio da Silva2012-10-151-6/+6
| |
* | ActiveRecord: sum expression returns string '0' for no records, fixedTim Macfarlane2012-10-151-0/+5
| |
* | #7914 Add change of previous commit to CHANGELOG.mdArturo Pie2012-10-131-0/+4
| |
* | learn ActiveRecord::QueryMethods#order work with hash argumentsTima Maslyuchenko2012-10-121-0/+10
|/
* Add CHANGELOG entry for "Fixtures" -> "FixtureSet"Alexey Muranov2012-10-071-1/+13
|
* PostgreSQL, quote table names when fetching the primary key. Closes #5920Yves Senn2012-10-051-0/+5
|
* Fix CHANGELOG entry [ci skip]Rafael Mendonça França2012-10-041-4/+4
|
* Count returns 0 without querying if parent is not savedFrancesco Rodriguez2012-10-031-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | Patches `CollectionAssociation#count` to return 0 without querying if the parent record is new. Consider the following code: class Account has_many :dossiers end class Dossier belongs_to :account end a = Account.new a.dossiers.build # before patch a.dossiers.count # SELECT COUNT(*) FROM "dossiers" WHERE "dossiers"."account_id" IS NULL # => 0 # after a.dosiers.count # fires without sql query # => 0 Fixes #1856.
* Fix reset_counters() crashing on has_many :through associations.lulalala2012-10-021-0/+5
| | | | | The counter column name in the intermediate model need to be access via the through reflection.
* Add missing CHANGELOG entry removed by mistake at 7f3b475 [ci skip]Rafael Mendonça França2012-09-281-11/+20
|
* Support for partial inserts.Jon Leighton2012-09-281-0/+13
| | | | | | | | | | | When inserting new records, only the fields which have been changed from the defaults will actually be included in the INSERT statement. The other fields will be populated by the database. This is more efficient, and also means that it will be safe to remove database columns without getting subsequent errors in running app processes (so long as the code in those processes doesn't contain any references to the removed column).
* Add #update_columns entry to AR Changelog.Sebastian Martinez2012-09-281-0/+11
|