aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/CHANGELOG.md
Commit message (Collapse)AuthorAgeFilesLines
* `where.not` adds `references` for `includes`.Yves Senn2014-03-171-0/+6
| | | | Closes #14406.
* format ActiveRecord CHANGELOG. [ci skip]Yves Senn2014-03-171-8/+9
|
* Extend fixture label replacement to allow string interpolationEric Steele2014-03-151-0/+10
| | | | | | | | | | | | | | Allows fixtures to use their $LABEL as part of a string instead of limiting use to the entire value. mark: first_name: $LABEL username: $LABEL1973 email: $LABEL@$LABELmail.com users(:mark).first_name # => mark users(:mark).username # => mark1973 users(:mark).email # => mark@markmail.com
* Make select_all on query cache accept a Relation without binds.Arthur Neves2014-03-131-0/+6
| | | | | [fixes #14361] [related #13886]
* passing an instance of an AR object to `find` is deprecatedAaron Patterson2014-03-131-0/+3
| | | | please pass the id of the AR object by calling `.id` on the model first.
* passing an ActiveRecord object to `exists?` is deprecated.Aaron Patterson2014-03-131-0/+3
| | | | | Pass the id of the object to the method by calling `.id` on the AR object.
* Merge pull request #13040 from kamipo/case_sensitive_comparisonRafael Mendonça França2014-03-121-0/+4
|\ | | | | | | | | | | | | Only use BINARY for mysql case sensitive uniqueness check when column has a case insensitive collation. Conflicts: activerecord/CHANGELOG.md
| * Only use BINARY for mysql case sensitive uniqueness check when column has a ↵Ryuta Kamizono2013-11-261-0/+4
| | | | | | | | case insensitive collation.
* | Changelog entry for mysql56 microsecondsArthur Neves2014-03-121-0/+4
| |
* | register OID for PostgreSQL citex datatype [Troy Kruthoff & Lachlan Sylvester]lsylvester2014-03-111-0/+5
| | | | | | | | citext makes it possible to use AR Hash finders for case-insensitive matching as sql UPPER/LOWER functions are not needed.
* | Merge pull request #8313 from alan/only_save_changed_has_one_objectsRafael Mendonça França2014-03-101-0/+6
|\ \ | | | | | | | | | | | | | | | | | | Save has_one associations only if record has changes Conflicts: activerecord/CHANGELOG.md
| * | Save has_one associations only if record has changesAlan Kennedy2013-10-311-0/+6
| | | | | | | | | | | | | | | | | | Prevents save related callbacks such as `after_commit` being triggered when `has_one` objects are already persisted and have no changes.
* | | Remove a reference to an issue [ci skip]Robin Dupret2014-03-051-1/+1
| | | | | | | | | | | | | | | This actually not an issue fixing ; the changelog is referring to the introducing pull request itself.
* | | quick pass over Active Record CHANGELOG. [ci skip].Yves Senn2014-03-051-13/+10
| | |
* | | Allow string hash values on AR order methodMarcelo Casiraghi2014-03-041-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | This behavior has almost no performance impact: String not allowed 66.910000 0.030000 66.940000 ( 67.024976) String allowed 69.360000 0.030000 69.390000 ( 69.503096) Benchmarked with http://git.io/Y0YuRw.
* | | Add Enum type to postgresql adapter's oids to prevent unknown OID warnings.Dieter Komendera2014-03-041-0/+5
| | |
* | | `includes` uses SQL parsing when String joins are involved.Yves Senn2014-02-281-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a partial revert of 22b3481ba2aa55fad1f9a5db94072312b345fb55. The current implementation of `references_eager_loaded_tables?` needs to know every table involved in the query. With the current API this is not possible without SQL parsing. While a2dab46cae35a06fd5c5500037177492a047c252 deprecated SQL parsing for `includes`. It did not issue deprecation warnings when String joins are involved. This resulted in a breaking change after the deprecated behavior was removed (22b3481ba2aa55fad1f9a5db94072312b345fb55). We will need to rethink the usage of `includes`, `preload` and `eager_load` but for now, this brings back the old *working* behavior.
* | | Fix a bug affecting validations of enum attributesTheMonster2014-02-271-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a bug where any enum attribute of a model would be evaluated always as 0 when calling the database on validations. This fix converts the value of the enum attribute to its integer value rather than the string before building the relation as the bug occured when the string finally gets converted to integer using string.to_i which converts it to 0. [Vilius Luneckas, Ahmed AbouElhamayed]
* | | let `insert_record` actuall save the object.Aaron Patterson2014-02-251-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `before_add` callbacks are fired before the record is saved on `has_and_belongs_to_many` assocations *and* on `has_many :through` associations. Before this change, `before_add` callbacks would be fired before the record was saved on `has_and_belongs_to_many` associations, but *not* on `has_many :through` associations. Fixes #14144
* | | Merge remote-tracking branch ↵Jon Leighton2014-02-251-0/+7
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 'chancancode/fix_instance_method_already_implemented' Conflicts: activerecord/CHANGELOG.md
| * | | Fixed STI classes not defining an attribute method if there is aGodfrey Chan2014-02-231-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | conflicting private method defined on its ancestors. The problem is that `method_defined_within?(name, klass, superklass)` only works correclty when `klass` and `superklass` are both `Class`es. If both `klass` and `superklass` are both `Class`es, they share the same inheritance chain, so if a method is defined on `klass` but not `superklass`, this method must be introduced at some point between `klass` and `superklass`. This does not work when `superklass` is a `Module`. A `Module`'s inheritance chain contains just itself. So if a method is defined on `klass` but not on `superklass`, the method could still be defined somewhere upstream, e.g. in `Object`. This fix works by avoiding calling `method_defined_within?` with a module while still fufilling the requirement (checking that the method is defined withing `superclass` but not is not a generated attribute method). 4d8ee288 is likely an attempted partial fix for this problem. This unrolls that fix and properly check the `superclass` as intended. Fixes #11569.
* | | | Point master changelogs to 4-1-stable branchCarlos Antonio da Silva2014-02-251-1858/+1
| | | | | | | | | | | | | | | | Remove 4-1 related entries from master [ci skip]
* | | | Coerce strings when reading attributes.Yves Senn2014-02-231-0/+11
|/ / /
* | | deprecate support for pg ranges with excluding beginnings.Yves Senn2014-02-231-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Ruby Range object does not support excluding beginnings. We currently support excluding beginnings for some subtypes using manually by incrementing them (now using the `#succ` method). This is approach is flawed as it's not equal to an excluding beginning. This commit deprecates the current support for excluding beginnings. It also raises an `ArgumentError` for subtypes that do not implement the `succ` method. This is a temporary solution to get rid of the broken state. We might still add complete support for excluding beginnings afterwards. (Probably with a new `PGRange` object, which acts like a `Range` but has excluding beginnings.
* | | dynamically define PostgreSQL OID range types.Yves Senn2014-02-231-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | This gets AR working with custom defined range types. It also removes the need for subtype specific branches in `OID::Range`. This expands the interface of all `OID` types with the `infinity` method. It's responsible to provide a value for positive and negative infinity.
* | | Typo fix for unscopeAmit Thawait2014-02-181-1/+1
| | |
* | | Merge branch '4-1-0-beta2'Rafael Mendonça França2014-02-181-0/+4
|\ \ \ | | | | | | | | | | | | | | | | | | | | Conflicts: actionview/CHANGELOG.md activerecord/CHANGELOG.md
| * | | Preparing for 4.1.0.beta2 releaseRafael Mendonça França2014-02-181-0/+4
| | | |
* | | | Don't use `# =>` when it is not the expression valuesRafael Mendonça França2014-02-181-9/+9
| | | | | | | | | | | | | | | | [ci skip]
* | | | Fix the column name [ci skip]Rafael Mendonça França2014-02-181-6/+6
| | | |
* | | | Document the default scopes change on the release notes, CHANGELOGRafael Mendonça França2014-02-181-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | and upgrating guides [ci skip]
* | | | Revert "Merge pull request #13344 from ccutrer/fix-from-default-select"Rafael Mendonça França2014-02-171-16/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 3ea840355409dc205a9e0d027fc09f1452636969, reversing changes made to e4cde5d58cbb09d1843796f96ba86225ff94fe05. Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/relation/query_methods.rb Reason: using `from` without `select` should not change the select list to SELECT * because it can lead different query results. If it is needed to change the table to a subquery or a view you can pass a table alias in the `from` call or use `select('subquery.*')`. Fixes #14049.
* | | | Fix typo [ci skip]Rafael Mendonça França2014-02-161-1/+1
| | | |
* | | | Resolve encoding issues with arrays of hstore (bug 11135).Josh Goodall2014-02-171-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We didn't have enough encoding for the wire protocol to store an array of hstore types. So, further encode any hstore that is an array member. Whilst we're here, ensure it's an HashWithIndifferentAccess being returned, to be consistent with other serialized forms, and add testing for arrays of hstore. So now the following migration: enable_extension "hstore" create_table :servers do |t| t.string :name t.hstore :interfaces, array: true end produces a model that can used like this, to store an array of hashes: server = Server.create(name: "server01", interfaces: [ { name: "bge0", ipv4: "192.0.2.2", state: "up" }, { name: "de0", state: "disabled", by: "misha" }, { name: "fe0", state: "up" }, ]) More at http://inopinatus.org/2013/07/12/using-arrays-of-hstore-with-rails-4/
* | | | Add a missing changelog entry for #13981 and #14035Robin Dupret2014-02-151-0/+7
| | | | | | | | | | | | | | | | [ci skip]
* | | | Drop the correct index after reverting a migrationHubert Dąbrowski2014-02-131-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | Previously when reverting a migration which added a named index it would instead drop a corresponding index with matching columns but without a name.
* | | | Merge branch 'dump-schema-after-migration-flag' of ↵Xavier Noria2014-02-061-0/+8
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://github.com/emilsoman/rails into emilsoman-dump-schema-after-migration-flag Conflicts: activerecord/CHANGELOG.md
| * | | | Add config to disable schema dump after migrationEmil Soman2014-02-061-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add a config on Active Record named `dump_schema_after_migration` * Schema dump doesn't happen if the config is set to false * Set default value of the config to true * Set config in generated production environment file to false * Update configuration guide * Update CHANGELOG
* | | | | synchronize 4.1 release notes with CHANGELOGS. [ci skip]Yves Senn2014-02-061-9/+13
| | | | | | | | | | | | | | | | | | | | /cc @chancancode
* | | | | Return sized enumerator from Enumerable#index_byMarc-Andre Lafortune2014-02-051-6/+1
| | | | |
* | | | | Return sized enumerator from Batches#find_eachMarc-Andre Lafortune2014-02-051-1/+7
| | | | |
* | | | | Return sized enumerator from Batches#find_in_batchesMarc-Andre Lafortune2014-02-051-0/+6
|/ / / /
* | | | Add CHANGELOG entry for #13935 [ci skip]Rafael Mendonça França2014-02-041-0/+9
| | | |
* | | | some wording format changes. [ci skip]Yves Senn2014-02-031-5/+5
| | | |
* | | | pass `habtm :autosave` to underlying `hm:t` association. Closes #13923.Yves Senn2014-02-031-0/+7
| | | |
* | | | Merge pull request #13688 from jbaudanza/psql-index-existsRafael Mendonça França2014-02-011-0/+10
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PostgreSQL implementation of SchemaStatements#index_name_exists? Conflicts: activerecord/CHANGELOG.md
| * | | | psql implementation of #index_name_exists?Jonathan Baudanza2014-01-161-0/+10
| | | | |
* | | | | Fixes issue with parsing whitespace content back from database - fixes #13907Mauricio Linhares2014-02-011-0/+11
| | | | |
* | | | | Minor changelog improvements [ci skip]Carlos Antonio da Silva2014-01-311-4/+4
| | | | |
* | | | | Associations now raise `ArgumentError` on name conflicts.Lauro Caetano2014-01-311-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | Dangerous association names conflicts include instance or class methods already defined by `ActiveRecord::Base`.