Commit Graph

6865 Commits

Author SHA1 Message Date
Xavier Noria
bbe7dac223 revert setting NOT NULL constraints in add_timestamps
Commit 3dbedd2 added NOT NULL constraints both to table
creation and modification. For creation the new default
makes sense, but the generic situation for changing a
table is that there exist records. Those records have
no creation or modification timestamps, and in the
general case you don't even know them, so when updating
a table these constraints are not going to work. See
a bug report for this use case in #3334.
2012-03-01 16:16:31 -08:00
Aaron Patterson
c2897901de Merge branch '3-2-2' into 3-2-stable
* 3-2-2:
  bumping to 3.2.2
  Ensure [] respects the status of the buffer.
  Merge pull request #4834 from sskirby/fix_usage_of_psql_in_db_test_prepare
  Merge pull request #5084 from johndouthat/patch-1
  updating RAILS_VERSION
  delete vulnerable AS::SafeBuffer#[]
  use AS::SafeBuffer#clone_empty for flushing the output_buffer
  add AS::SafeBuffer#clone_empty
  fix output safety issue with select options
2012-03-01 09:51:51 -08:00
Aaron Patterson
01b470f526 bumping to 3.2.2 2012-03-01 09:16:28 -08:00
kennyj
f1f2e8c80b Fix type_to_sql with text and limit on mysql/mysql2. Fix GH #3931. 2012-02-29 01:23:37 +09:00
Rafael Mendonça França
663904f869 Revert "No need to pass options which is never used"
Options is needed for some Rails extensions to determine when
referential integrity should be disabled

This reverts commit bcb466c543.

Fixes #5052
2012-02-26 12:08:44 -08:00
Noah Hendrix
e1f799a42f Fixed typo in composed_of example with Money#<=>, was comparing amount itself instead of other_money.amount 2012-02-25 21:54:38 +05:30
Aaron Patterson
ecff25cda6 Merge pull request #4834 from sskirby/fix_usage_of_psql_in_db_test_prepare
Fix usage of psql in db:test:prepare
2012-02-23 11:03:49 -08:00
Aaron Patterson
6dbf6f39f9 Merge pull request #4834 from sskirby/fix_usage_of_psql_in_db_test_prepare
Fix usage of psql in db:test:prepare
2012-02-23 11:00:09 -08:00
Aaron Patterson
4bcd437f76 updating RAILS_VERSION 2012-02-22 12:03:13 -08:00
Aaron Patterson
35626feb61 bumping up arel 2012-02-21 16:13:56 -08:00
Aaron Patterson
83e42d52e3 prepared statements can be disabled 2012-02-21 16:09:01 -08:00
Aaron Patterson
a566ee5308 tag bind params with a bind param object 2012-02-21 15:46:18 -08:00
Aaron Patterson
c73f8833d5 more ruby 2.0 respond_to? changes 2012-02-21 11:37:12 -08:00
Aaron Patterson
d70ed102c8 Merge pull request #5096 from lawso017/master
Restoring ability to derive id/sequence from tables with nonstandard sequences for primary keys
2012-02-21 09:17:59 -08:00
kennyj
39d4617033 Fix some warnings on 3-2-stable 2012-02-21 12:43:41 +09:00
Arun Agrawal
742b6159d5 fix test with ruby 187-p358 2012-02-18 15:47:24 +05:30
José Valim
5f9a5a51de Merge pull request #5038 from carlosantoniodasilva/fix-db-migrate-redo
Always reenable _dump task in AR databases rake. Closes #5030
2012-02-14 12:10:56 +01:00
Rafael Mendonça França
7c167dd2de Use real table and columns for index test 2012-02-08 11:53:32 -02:00
José Valim
d3d807a173 Push proper test changes for previous commit conflicts. 2012-02-08 14:06:44 +01:00
Paul Sadauskas
0a75336c89 Handle nil in add_index :length option in MySQL
Our schema.rb is being generated with an `add_index` line similar to this:

    add_index "foo", ["foo", "bar"], :name => "xxx", :length => {"foo"=>8, "bar=>nil}

This is the same as it was on Rails 3.1.3, however, now when that
schema.rb is evaluated, its generating bad SQL in MySQL:

    Mysql::Error: You have an error in your SQL syntax; check the manual
    that corresponds to your MySQL server version for the right syntax
    to use near '))' at line 1: CREATE UNIQUE INDEX
    `xxx` ON `foo` (`foo`(8), `bar`())

This commit adds a check for nil on the length attribute to prevent the
empty parens from being output.

Conflicts:

	activerecord/test/cases/migration/index_test.rb

Signed-off-by: José Valim <jose.valim@gmail.com>
2012-02-08 13:34:04 +01:00
Jon Leighton
77b4edce15 Fix attribute_before_type_cast for serialized attributes. Fixes #4837.
Conflicts:

	activerecord/lib/active_record/core.rb
2012-02-07 23:41:21 +00:00
Xavier Noria
dafc3c7a06 no need to check for this constant 2012-02-07 21:20:54 +01:00
Markus Fenske
8c7378aae8 Fixed the documenation for 'to_xml' 2012-02-07 17:32:15 +01:00
Xavier Noria
ee6e3c128b let automatic EXPLAIN ignore CACHE notifications 2012-02-03 16:12:18 -08:00
densya203
daa266536e Fix Issue #4819
'uninitialized constant ActiveRecord::Deprecation in Rails3.2.1'

Just a typo of 'ActiveSupport::...'
2012-02-04 00:51:08 +09:00
Aaron Patterson
4ca633e466 Merge pull request #4809 from cfeist/feist-sqlite-binary-corruption
Fix for SQLite binary data corrupter (to master branch)
2012-02-02 09:16:06 -08:00
Jon Leighton
42dab646eb Merge pull request #4543 from jdelStrother/find_or_init
Don't instantiate two objects in collection proxy / find_or_instantiate_by
2012-02-01 23:19:25 +00:00
Rafael Mendonça França
f532cd1040 Fix broken tests added by 85c724d59 2012-01-31 23:39:29 -02:00
Jon Leighton
e1de54079b Improve deprecation message 2012-01-31 20:26:16 +00:00
Jon Leighton
85c724d59e Merge pull request #4783 from gregolsen/ids_reader_fix
ids_reader method fixed, test added to has_many association (for PostgreSQL)
2012-01-31 13:51:09 +00:00
Jon Leighton
b2955edcea Allow writing unknown attributes, but with a deprecation warning. Closes #4583. 2012-01-31 08:50:36 +00:00
Jon Leighton
0bfc504d9c Add workaround and deprecation if the inherited hook is not executed. Closes #4757. 2012-01-31 08:41:51 +00:00
Jon Leighton
c472843bbc Merge pull request #4763 from kennyj/fix_4754
[MySQL] Fix GH #4754. Remove double-quote characters around PK when using sql_mode=ANSI_QUOTES
2012-01-31 08:23:25 +00:00
Xavier Noria
413790559c query cache instrumentation should included the bindings in the payload [closes #4750] 2012-01-30 13:48:05 -08:00
Jon Leighton
1c5bd8a33d Merge pull request #4715 from pwim/find-create-multi-args
Fix regression from Rails 3.1
2012-01-27 09:31:48 +00:00
Xavier Noria
67b8fbca92 updating RAILS_VERSION 2012-01-26 14:54:02 -08:00
Xavier Noria
97e8d1d819 CHANGELOG revision for v3.2.1 2012-01-26 14:28:48 -08:00
Aaron Patterson
5ac5acd63e Merge pull request #4696 from rafaelfranca/issue-4653
Remove extra attributes from HABTM join tables in AR tests
2012-01-26 09:41:04 -08:00
Rafael Mendonça França
06dcd9c0fb Remove extra attributes from HABTM join tables in AR tests
HABTM Join tables should not have extra attributes

When extra attributes is needed in HABTM join tables is better to use
`has_many :through` association.

Fix #4653
2012-01-26 10:32:10 -02:00
Xavier Noria
280937578b registers 2483460 in the CHANGELOG 2012-01-26 13:04:40 +01:00
Xavier Noria
24834606c2 disable automatic explain if there is no logger [closes #4671] 2012-01-26 02:51:18 -08:00
Sergey Nartimov
36d7af34d6 call to_s on value passed to table_name=
Signed-off-by: José Valim <jose.valim@gmail.com>
2012-01-26 08:19:45 +01:00
Jon Leighton
fab664a8e9 Fix another race condition.
From 2c667f69aa2daac5ee6c29ca9679616e2a71532a.

Thanks @pwnall for the heads-up.

Conflicts:

	activerecord/lib/active_record/core.rb
2012-01-20 18:31:41 +00:00
David Heinemeier Hansson
f36dcaf488 Preparing for 3.2.0 release 2012-01-20 17:44:32 +01:00
Aaron Patterson
4c5b73fef8 Merge pull request #4531 from exviva/pessimistic_with_lock
Add ActiveRecord::Base#with_lock
2012-01-19 09:39:20 -08:00
Vijay Dev
c8b584f576 select doesn't take multiple arguments - fixes #4539 [ci skip]
Didn't cherry pick the master commit because this one already had some
of the fixes made in master.
2012-01-19 21:58:19 +05:30
Aaron Patterson
57f73a6bcf Merge pull request #4487 from sarenji/fix-reset-counters
Fix bug where reset_counters resets the wrong counter cache.
2012-01-17 10:23:56 -08:00
Jon Leighton
70b762d1a7 Fix race condition 💣 2012-01-13 22:58:26 +00:00
Piotr Sarnacki
0d1df723c7 Fix table_name in ActiveRecord with more than one abstract ancestors
When subclassing abstract_class table_name should be always computed
based on class name, no matter if superclass is subclassing base
or another abstract_class. So:

class FirstAbstract < ActiveRecord::Base
  self.abstract_class = true
end
class SecondAbstract < FirstAbstract
  self.abstract_class = true
end

class Post < SecondAbstract
  self.table_name #=> 'posts' (not 'second_abstracts')
end
2012-01-12 20:53:01 +01:00
Aaron Patterson
1d74af6688 moving to arel 3.0.0 2012-01-12 11:39:35 -08:00