aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
Commit message (Collapse)AuthorAgeFilesLines
* please use Ruby, not ActiveSupportAaron Patterson2014-04-111-1/+1
|
* :scissors:Rafael Mendonça França2014-04-111-2/+2
|
* Merge pull request #14711 from ↵Rafael Mendonça França2014-04-112-3/+10
|\ | | | | | | | | | | swoker/activerecord_fix_aggregate_methods_with_select Activerecord fix aggregate methods with select
| * fix exception on polymorphic associations with predicatesSimon Woker2014-04-111-0/+8
| |
| * Fix error for aggregate methods with select, see issue #13648Simon Woker2014-04-101-3/+2
| |
* | PostgreSQL, warn once per connection per missing OID. Closes #14275.Yves Senn2014-04-111-2/+2
| | | | | | | | [Yves Senn & Matthew Draper]
* | PostgreSQL, adapter automatically reloads it's type map. Closes #14678.Yves Senn2014-04-113-10/+22
| | | | | | | | [Yves Senn & Matthew Draper]
* | docs, make association `autosave: true` examples runnable. Closes #14700Yves Senn2014-04-111-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | [ci skip] The examples are written in a way you expect them to be executable. However one snippet assumed there to be two comments when only one was created above. The defined models did not extend `ActiveRecord::Base` The example used `comments.last.mark_for_destruction`. This does no longer load the whole collection but just the last record. It is then refetcht on subsequent calls to `last`. This breaks the example.
* | Merge pull request #12829 from iantropov/issue_insert_via_hmt_scope_3548Rafael Mendonça França2014-04-102-3/+7
|\ \ | | | | | | | | | | | | | | | | | | Fix insertion of records for hmt association with scope Conflicts: activerecord/CHANGELOG.md
| * | Fix insertion of records for hmt association with scope, fix #3548Ivan Antropov2013-11-172-3/+7
| | |
* | | No need to call sendRafael Mendonça França2014-04-101-1/+1
| | |
* | | Merge branch 'master' into rm-uuid-fixturesRafael Mendonça França2014-04-1020-80/+60
|\ \ \ | | |/ | |/| | | | | | | | | | Conflicts: activerecord/CHANGELOG.md activesupport/CHANGELOG.md
| * | Only call uniq on the conditional that actually needs itCarlos Antonio da Silva2014-04-091-1/+1
| | |
| * | Remove extra collect callCarlos Antonio da Silva2014-04-091-1/+1
| | |
| * | Make the aggregate_reflections cache work with strings as its keys.Lauro Caetano2014-04-091-2/+2
| | |
| * | No need to call `to_sym` on reflection name, since the cache now worksLauro Caetano2014-04-091-2/+2
| | | | | | | | | | | | | | | | | | with strings with string keys. Related #14668.
| * | Make the reflections cache work with strings as its keys.Lauro Caetano2014-04-091-2/+2
| | |
| * | The `source` option for `has_many => through` should accept StringLauro Caetano2014-04-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | values. With the changes introduced by 16b70fddd4dc7e7fb7be108add88bae6e3c2509b it was expecting the value to be a Symbol, while it could be also a String value.
| * | Drop in @jeremy's new database.yml template textMatthew Draper2014-04-091-1/+1
| | | | | | | | | | | | | | | In passing, allow multi-word adapters to be referenced in a URL: underscored_name must become hyphened-name.
| * | Don't deprecate after allMatthew Draper2014-04-091-16/+2
| | |
| * | Less ambition, more deprecationMatthew Draper2014-04-091-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | The "DATABASE_URL_*" idea was moving in the wrong direction. Instead, let's deprecate the situation where we end up using ENV['DATABASE_URL'] at all: the Right Way is to explicitly include it in database.yml with ERB.
| * | Give a deprecation message even when the lookup failsMatthew Draper2014-04-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the supplied string doesn't contain a colon, it clearly cannot be a database URL. They must have intended to do a key lookup, so even though it failed, give the explanatory deprecation warning, and raise the exception that lists the known configs. Conveniently, this also simplifies our logical behaviour: if the string matches a known configuration, or doesn't contain a colon (and is therefore clearly not a URL), then we output a deprecation warning, and behave exactly as we would if it were a symbol.
| * | Rearrange the config merger some moreMatthew Draper2014-04-081-19/+16
| | | | | | | | | | | | | | | | | | | | | This seems to simplify the operative part. Most importantly, by pre-loading all the configs supplied in ENV, we ensure the list is complete: if the developer specifies an unknown config, the exception includes a list of valid ones.
| * | entry is always a HashRafael Mendonça França2014-04-081-1/+1
| | |
| * | Check env_url only onceRafael Mendonça França2014-04-081-2/+7
| | |
| * | Only call DEFAULT_ENV proc one timeRafael Mendonça França2014-04-081-2/+5
| | |
| * | Make sure DEFAULT_URL only override current environment databaseRafael Mendonça França2014-04-081-1/+1
| | | | | | | | | | | | configuration
| * | Only apply DATABASE_URL for Rails.envMatthew Draper2014-04-081-28/+14
| | | | | | | | | | | | | | | As we like ENV vars, also support DATABASE_URL_#{env}, for more obscure use cases.
| * | Ensure we are looking with string keysGodfrey Chan2014-04-071-1/+1
| | |
| * | Follow up to bbe7fe41 to fix enum leakage across classes.Godfrey Chan2014-04-072-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | The original attempt didn't really fix the problem and wasn't testing the problematic area. This commit corrected those issues in the original commit. Also removed the private `enum_mapping_for` method. As `defined_enums` is now a method, this method doesn't provide much value anymore.
| * | Merge pull request #14634 from laurocaetano/fix_reorderRafael Mendonça França2014-04-072-4/+3
| |\ \ | | | | | | | | Build the reverse_order on its proper method.
| | * | Build the reverse_order on its proper method.Lauro Caetano2014-04-072-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The reverse_order method was using a flag to control if the order should be reversed or not. Instead of using this variable just build the reverse order inside its proper method. This implementation was leading to an unexpected behavior when using reverse_order and then applying reorder(nil). Example: Before Post.order(:name).reverse_order.reorder(nil) # => SELECT "posts".* FROM "posts" ORDER BY "posts"."id" DESC After Post.order(:name).reverse_order.reorder(nil) # => SELECT "posts".* FROM "posts"
| * | | remove check for present? from delete_alleileencodes2014-04-071-2/+2
| |/ / | | | | | | | | | | | | Passing in a blank string is a bug so there's no reason to check for a blank string.
| * | Merge pull request #14632 from matthewd/escape_byteaRafael Mendonça França2014-04-071-2/+2
| |\ \ | | | | | | | | Use connection-specific bytea escaping
| | * | Use connection-specific bytea escapingMatthew Draper2014-04-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In our normal usage, it's rare for this to make a difference... but is more technically correct. As well as a spec that proves this is a good idea, let's also add a more sane-looking one that just covers basic to_sql functionality. There aren't many places where we actually use escape_bytea, but that's one that won't be going away.
| * | | Ignore order when doing count.Lauro Caetano2014-04-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is necessary because Postgresql doesn't play nice with ORDER BY and no GROUP BY. Fixes #14621.
| * | | Merge pull request #14609 from evanwhalen/enums_inheritanceRafael Mendonça França2014-04-071-4/+6
| |\ \ \ | | |/ / | |/| | Make enums distinct per class
| | * | make enums distinct per classEvan Whalen2014-04-071-4/+6
| | | |
| * | | fix CollectionProxy delete_all documentationeileencodes2014-04-061-6/+1
| |/ / | | | | | | | | | | | | | | | | | | This method no longer returns an array of all records that have been removed. Correct documentation to reflect this change. See issue 14546
| * | Merge pull request #14579 from senny/pg/remove_string_limitRafael Mendonça França2014-04-042-2/+2
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | PostgreSQL, remove varchar limit. Conflicts: activerecord/CHANGELOG.md
| | * | PostgreSQL and SQLite, remove varchar limit. [Vladimir Sazhin & Toms Mikoss ↵Yves Senn2014-04-042-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | & Yves Senn] There is no reason for the PG adapter to have a default limit of 255 on :string columns. See this snippet from the PG docs: Tip: There is no performance difference among these three types, apart from increased storage space when using the blank-padded type, and a few extra CPU cycles to check the length when storing into a length-constrained column. While character(n) has performance advantages in some other database systems, there is no such advantage in PostgreSQL; in fact character(n) is usually the slowest of the three because of its additional storage costs. In most situations text or character varying should be used instead.
| * | | Merge pull request #11650 from prathamesh-sonpatki/renameRafael Mendonça França2014-04-048-19/+19
| |\ \ \ | | | | | | | | | | | | | | | Renamed private methods _create_record and _update_record
| | * | | [Active Record] Renamed private methods create_record and update_recordPrathamesh Sonpatki2014-02-208-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is to ensure that they are not accidentally called by the app code. They are renamed to _create_record and _update_record respectively. Closes #11645
| * | | | Merge pull request #14562 from jefflai2/collection_proxyRafael Mendonça França2014-04-041-0/+4
| |\ \ \ \ | | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | CollectionProxy uses the arel of its association's scope. Conflicts: activerecord/CHANGELOG.md
| | * | | CollectionProxy uses the arel of its association's scope.Jefferson Lai2014-04-021-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CollectionProxy should be able to reuse the behavior (methods) of its parent class, but with its own state. This change allows CollectionProxy to use the arel object corresponding to its association's scope.
* | | | | Merge pull request #12016 from roderickvd/uuid_fixesRafael Mendonça França2014-04-041-9/+24
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Auto-generate stable fixture UUIDs on PostgreSQL Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/fixtures.rb activerecord/test/cases/adapters/postgresql/uuid_test.rb activesupport/CHANGELOG.md
| * | | | Auto-generate stable fixture UUIDs on PostgreSQL.Roderick van Domburg2014-01-071-9/+24
| | | | | | | | | | | | | | | | | | | | Fixes: #11524
* | | | | Block a few default Class methods as scope name.Arthur Neves2014-04-031-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add tests to make sure scopes cannot be create with names such as: private, protected, public. Make sure enum values don't collide with those methods too.
* | | | | Merge pull request #14569 from matthewd/sqlite_relative_deprecatedRafael Mendonça França2014-04-031-17/+30
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revise 'sqlite3:' URL handling for smoother upgrades Conflicts: activerecord/CHANGELOG.md
| * | | | | Complete change of `sqlite3:///` path handlingMatthew Draper2014-04-031-15/+1
| | | | | | | | | | | | | | | | | | | | | | | | That which was now relative is now absolute.