- 21 10月, 2012 1 次提交
-
-
由 Jeremy Kemper 提交于
This reverts commit 83846838.
-
- 20 10月, 2012 1 次提交
-
-
由 Jon Leighton 提交于
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.
-
- 19 10月, 2012 3 次提交
-
-
由 Jon Leighton 提交于
This reflects the fact that it now impact inserts as well as updates.
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
This is similar to #first_or_create, but slightly different and a nicer API. See the CHANGELOG/docs in the commit. Fixes #7853
-
- 17 10月, 2012 1 次提交
-
-
由 Scott Willson 提交于
Would incorrectly add duplicated errors when the association was blank. Bug introduced in 1fab518c.
-
- 16 10月, 2012 3 次提交
-
-
由 Christian Seiler 提交于
Call super to nullify the reference to the original errors object in the dup'ed object (call ActiveModel::Validations#initialize_dup). Closes #7291
-
由 Carlos Antonio da Silva 提交于
-
由 Tim Macfarlane 提交于
-
- 14 10月, 2012 1 次提交
-
-
由 Arturo Pie 提交于
-
- 12 10月, 2012 1 次提交
-
-
由 Tima Maslyuchenko 提交于
-
- 08 10月, 2012 1 次提交
-
-
由 Alexey Muranov 提交于
-
- 05 10月, 2012 1 次提交
-
-
由 Yves Senn 提交于
-
- 04 10月, 2012 2 次提交
-
-
由 Rafael Mendonça França 提交于
-
由 Francesco Rodriguez 提交于
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.
-
- 02 10月, 2012 1 次提交
-
-
由 lulalala 提交于
The counter column name in the intermediate model need to be access via the through reflection.
-
- 29 9月, 2012 3 次提交
-
-
由 Rafael Mendonça França 提交于
-
由 Jon Leighton 提交于
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).
-
由 Sebastian Martinez 提交于
-
- 24 9月, 2012 1 次提交
-
-
由 John Foley 提交于
-
- 22 9月, 2012 1 次提交
-
-
由 Santiago Pastorino 提交于
This reverts commit 761bc751. This commit wasn't fixing any issue just using the same table for different models with different primary keys.
-
- 21 9月, 2012 3 次提交
-
-
由 Jon Leighton 提交于
If your database supports setting the isolation level for a transaction, you can set it like so: Post.transaction(isolation: :serializable) do # ... end Valid isolation levels are: * `:read_uncommitted` * `:read_committed` * `:repeatable_read` * `:serializable` You should consult the documentation for your database to understand the semantics of these different levels: * http://www.postgresql.org/docs/9.1/static/transaction-iso.html * https://dev.mysql.com/doc/refman/5.0/en/set-transaction.html An `ActiveRecord::TransactionIsolationError` will be raised if: * The adapter does not support setting the isolation level * You are joining an existing open transaction * You are creating a nested (savepoint) transaction The mysql, mysql2 and postgresql adapters support setting the transaction isolation level. However, support is disabled for mysql versions below 5, because they are affected by a bug (http://bugs.mysql.com/bug.php?id=39170) which means the isolation level gets persisted outside the transaction.
-
由 Francesco Rodriguez 提交于
-
由 Francesco Rodriguez 提交于
-
- 20 9月, 2012 1 次提交
-
-
由 Guillermo Iguaran 提交于
-
- 19 9月, 2012 2 次提交
-
-
由 Rafael Mendonça França 提交于
-
由 Damien Mathieu 提交于
Closes #6960
-
- 18 9月, 2012 1 次提交
-
-
由 Xavier Noria 提交于
-
- 17 9月, 2012 3 次提交
-
-
由 Rafael Mendonça França 提交于
-
由 Ernie Miller 提交于
If assigning to a has_many :through collection against an unsaved object using the collection=[<array_of_items>] syntax, the join models were not properly created, previously.
-
由 Francesco Rodriguez 提交于
-
- 16 9月, 2012 2 次提交
-
-
由 kennyj 提交于
-
由 Toshiyuki Kawanishi 提交于
-
- 14 9月, 2012 1 次提交
-
-
由 Dan McClain 提交于
Having column related schema dumper code in the AbstractAdapter. The code remains the same, but by placing it in the AbstractAdapter, we can then overwrite it with Adapter specific methods that will help with Adapter specific data types. The goal of moving this code here is to create a new migration key for PostgreSQL's array type. Since any datatype can be an array, the goal is to have ':array => true' as a migration option, turning the datatype into an array. I've implemented this in postgres_ext, the syntax is shown here: https://github.com/dockyard/postgres_ext#arrays Adds array migration support Adds array_test.rb outlining the test cases for array data type Adds pg_array_parser to Gemfile for testing Adds pg_array_parser to postgresql_adapter (unused in this commit) Adds schema dump support for arrays Adds postgres array type casting support Updates changelog, adds note for inet and cidr support, which I forgot to add before Removing debugger, Adds pg_array_parser to JRuby platform Removes pg_array_parser requirement, creates ArrayParser module used by PostgreSQLAdapter
-
- 13 9月, 2012 1 次提交
-
-
由 Matt Jones 提交于
-
- 12 9月, 2012 2 次提交
-
-
由 beerlington 提交于
Allows you to specify the model association key in a belongs_to relationship instead of the foreign key. The following queries are now equivalent: Post.where(:author_id => Author.first) Post.where(:author => Author.first) PriceEstimate.where(:estimate_of_type => 'Treasure', :estimate_of_id => treasure) PriceEstimate.where(:estimate_of => treasure)
-
由 kennyj 提交于
-
- 09 9月, 2012 2 次提交
-
-
由 Ernie Miller 提交于
When calling a query method on an attribute that was not selected by an ActiveRecord query, an ActiveModel::MissingAttributeError is not raised. Instead, a nil value is returned, which will return false once cast to boolean. This is undesirable, as we should not give the impression that we know the attribute's boolean value when we haven't loaded the attribute's (possibly) non-boolean value from the database. This issue is present on versions going back as far as 2.3, at least.
-
由 Francesco Rodriguez 提交于
-
- 08 9月, 2012 1 次提交
-
-
由 Carlos Antonio da Silva 提交于
-