aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/CHANGELOG.md
Commit message (Collapse)AuthorAgeFilesLines
* 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
* | 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.