Commit Graph

6370 Commits

Author SHA1 Message Date
Hendy Tanata
21e2eeacff Remove unused require. 2011-08-16 12:40:57 +08:00
Jon Leighton
03a045b306 Bump arel dependency 2011-08-15 23:10:16 +01:00
Jon Leighton
c3dcb795f1 Use new SelectManager#source method 2011-08-15 23:10:16 +01:00
Jon Leighton
cc206a3507 Use new SelectManager#projections= method 2011-08-15 23:10:16 +01:00
Jon Leighton
12aaad0848 use update.key instead of update.ast.key. make better use of select manager. 2011-08-15 23:10:16 +01:00
Jon Leighton
8778c82e32 Use a SelectCore rather than a full SelectManager 2011-08-15 23:10:15 +01:00
Jon Leighton
fe0ec85541 Refactor building the update manager 2011-08-15 23:10:15 +01:00
Jon Leighton
43b99f290a Support for multi-table updates with limits, offsets and orders 2011-08-15 23:10:15 +01:00
Jon Leighton
128d006242 Support updates with joins. Fixes #522. 2011-08-15 23:10:15 +01:00
Jon Leighton
57423d815b Ensure empty has_many :through association preloaded via joins is marked as loaded. Fixes #2054. 2011-08-15 16:01:01 +01:00
Jon Leighton
7b56fb034a Fix private methods which are delegated to. This previously worked because Module#delegate previously ignored method visibility. 2011-08-15 12:38:44 +01:00
Xavier Noria
bf2b9d2de3 Merge branch 'master' of github.com:lifo/docrails
Conflicts:
	RELEASING_RAILS.rdoc
	actionpack/lib/sprockets/railtie.rb
	actionpack/test/template/sprockets_helper_test.rb
	activerecord/test/cases/calculations_test.rb
	railties/guides/source/3_1_release_notes.textile
	railties/guides/source/active_resource_basics.textile
	railties/guides/source/command_line.textile
2011-08-13 16:30:07 -07:00
Florent Guilleux
56efdbc626 Document exclamation point on dynamic finders 2011-08-13 16:22:34 -07:00
Sukeerthi Adiga
b905f8c963 Rubygems => RubyGems 2011-08-13 16:22:31 -07:00
Jon Leighton
66e114cd0c Quote these dates to prevent intermittent test failure. Suppose local time is 00:50 GMT+1. Without the quoting, the YAML parser would parse this as 00:50 UTC, into the local time of 01:50 GMT+1. Then, it would get written into the database in local time as 01:50. When it came back out the UTC date from the database and the UTC date of two weeks ago would be compared. The former would be 23:50, and the latter would be 00:50, so the two dates would differ, causing the assertion to fail. Quoting it prevents the YAML parser from getting involved. 2011-08-13 16:22:29 -07:00
artemk
bb72183bca accept option for recreate db for postgres (same as mysql now) 2011-08-13 16:22:28 -07:00
Aaron Patterson
1ff52cbe81 initializing @open_transactions in the initialize method 2011-08-13 16:22:28 -07:00
Aaron Patterson
d6af6fc0c0 add a migrate class method and delegate to the new instance 2011-08-13 16:22:27 -07:00
Christopher Meiklejohn
9d31acf8b9 Ensure that .up and .down work as well. 2011-08-13 16:22:27 -07:00
Christopher Meiklejohn
9d19bae233 Support backwards compatible interface for migration down/up with rails 3.0.x. 2011-08-13 16:22:27 -07:00
Vishnu Atrai
665a89ed4f remove extra require for 'stringio' as it is required in helper.rb 2011-08-13 16:22:26 -07:00
Arun Agrawal
3d2bda9601 magic comment test only if encoding_aware?. 2011-08-13 16:22:25 -07:00
Brian Cardarella
3d87d01dad Resolve warnings by instantizing @attrubtes as nil 2011-08-13 16:22:25 -07:00
Aaron Patterson
4a74493816 default writing the schema file as utf-8 2011-08-13 16:22:24 -07:00
Aaron Patterson
17a66a8ddc dump IO encoding value along with schema.rb so the file can be reloaded. fixes #1592 2011-08-13 16:22:24 -07:00
Jon Leighton
bec5977932 Revert "Merge pull request #2309 from smasry/master"
This reverts commit 9d396ee819, reversing
changes made to fa2bfd832c.

Reason: the change broke the build.
2011-08-13 16:22:22 -07:00
Samer Masry
c751bb1ac2 Reverse order fix when using function for ActiveRecord::QueryMethods Fixes #1697 2011-08-13 16:22:20 -07:00
Dmitriy Kiriyenko
4c873cbf36 Fixed failing query when performing calculation with having based on select. 2011-08-13 16:22:20 -07:00
Jon Leighton
05f1a9bcc3 Add a proxy_association method to association proxies, which can be called by association extensions to access information about the association. This replaces proxy_owner etc with proxy_association.owner. 2011-08-13 16:22:20 -07:00
Vishnu Atrai
745d90bde3 remove deprication warning: ambiguous first argument; put parentheses or even spaces 2011-08-13 16:22:17 -07:00
Vishnu Atrai
5a92c6627e remove deprication warning for ruby 1.9.3-head for unused variables 2011-08-13 16:22:17 -07:00
Piotr Sarnacki
182a428418 Revert "allow select to have multiple arguments"
This reverts commit 04cc446d17.

I reverted it because apparently we want to use: select([:a, :b])
instead of select(:a, :b), but there was no tests for that form.
2011-08-13 16:22:17 -07:00
Sławosz Sławiński
e7f7439d06 allow select to have multiple arguments 2011-08-13 16:22:16 -07:00
Franck Verrot
5004aaffc1 Simplify the test by using id and name. id will be the only real sort criteria in any case as it's unique. 2011-08-13 16:22:16 -07:00
Xavier Noria
b537595665 Revert "Explicitly included hashes in sentence regarding SQL-injection-safe forms"
Reason: The hash form is secure, and preferred over the array form if possible.

This reverts commit 6dc749596c.
2011-08-13 16:22:15 -07:00
Vijay Dev
7372e9ae9a make the warning clear about the effect of using validates_associated on both sides on an association. 2011-08-13 16:22:11 -07:00
Jon Leighton
9ecc4433bb Perf: don't mess around with thread local vars unless we actually need to 2011-08-13 16:54:05 +01:00
Jon Leighton
24f902b1bc Fix default scope thread safety. Thanks @thedarkone for reporting. 2011-08-13 16:54:05 +01:00
José Valim
291072a64a Merge pull request #2514 from myronmarston/fix_active_record_observer_disabling
Allow ActiveRecord observers to be disabled.
2011-08-13 08:40:13 -07:00
Jon Leighton
34689c40a0 Work around for lolruby bug. (Read on for explanation.)
We were experiencing CI test failures, for example:

* 3-1-stable: http://travis-ci.org/#!/rails/rails/builds/79473/L407
* master: http://travis-ci.org/#!/rails/rails/builds/79507/L80

These failures only happened on 1.8.7-p352, and we were only able to
reproduce on the Travis CI VM worker. We even tried creating a new 32
bit Ubuntu VM and running the tests on that, and it all worked fine.

After some epic trial and error, we discovered that replacing the
following:

  fuu = Marshal.load(Marshal.dump(fuu))

with:

  marshalled = Marshal.dump(fuu)
  fuu = Marshal.load(marshalled)

seemed to prevent the failure.

We have NO IDEA why this is. If anyone has some great insight to
contribute then that is welcome. Otherwise, hopefully this will just
help us get the CI green again.

Many thanks to @joshk for help with sorting this out.
2011-08-13 13:54:54 +01:00
Myron Marston
d3c15a1d31 Allow ActiveRecord observers to be disabled.
We have to use Observer#update rather than Observer#send since the enabled state is checked in #update before forwarding the method call on.
2011-08-12 20:48:44 -07:00
Aaron Patterson
d00e1646f7 add the gem requirement for sqlite3 2011-08-10 11:39:48 -07:00
Jon Leighton
4f8801963c Okay, the new incompatible arel is now called 2.2 and the sun shines upon thee once more 2011-08-09 22:05:48 +01:00
Jon Leighton
5680a51dcb Remove TODO comment I didn't mean to commit 2011-08-09 00:00:52 +01:00
Jon Leighton
5870291425 Bump arel version 2011-08-08 23:51:07 +01:00
Jon Leighton
9062b75bb7 Fully marshal AR::Base objects. Fixes #2431. 2011-08-08 23:28:49 +01:00
Jon Leighton
7db90aa7c7 Make it the responsibility of the connection to hold onto an ARel visitor for generating SQL. This improves the code architecture generally, and solves some problems with marshalling. Adapter authors please take note: you now need to define an Adapter.visitor_for method, but it degrades gracefully with a deprecation warning for now. 2011-08-08 23:28:23 +01:00
Raimonds Simanovskis
58af0d46cf Fixed test_disable_referential_integrity on Oracle
On Oracle disable_referential_integrity before execution of block will disable foreign key constraints and after block will enable them but when constraints are enabled then they are validated. Therefore created record with invalid foreign key should be deleted before enabling foreign key constraints.
2011-08-08 22:32:26 +03:00
Gustavo Delfino
cdb49fc2f3 sqlite transactions now logged
motivation: http://stackoverflow.com/questions/6892630/sqlite-transactions-not-showing-in-test-log
2011-08-06 16:05:45 -04:30
Santiago Pastorino
1b676fc760 Revert "to_key on a destroyed model should return nil". Closes #2440
This reverts commit c5448721b5.
2011-08-05 19:39:19 -03:00