Commit Graph

6157 Commits

Author SHA1 Message Date
Santiago Pastorino
216d79ef63 Revert "to_key on a destroyed model should return nil". Closes #2440
This reverts commit c5448721b5.
2011-08-05 19:40:05 -03:00
Santiago Pastorino
8118e419ff Fix test for Rubinius 2011-08-05 16:49:50 -03:00
Xavier Noria
9efc57f2b7 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-04 16:57:43 -07:00
Vijay Dev
c93adf85a7 make the warning clear about the effect of using validates_associated on both sides on an association. 2011-08-04 16:48:34 -07:00
ejy
740e531688 Removed trailing slash of 'Download and installation' Github URL as per convention 2011-08-04 16:45:25 -07:00
Pete Campbell
f9bd8b2a72 Explicitly included hashes in sentence regarding SQL-injection-safe forms 2011-08-04 16:45:21 -07:00
Jon Leighton
26c410e56f 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.
Conflicts:

	activerecord/test/fixtures/pirates.yml
2011-08-04 00:48:54 +01:00
Aaron Patterson
c1b85edc2d fixing deprecation notice for dynamic finders that use hashes. fixes #2404 2011-08-03 15:31:48 -07:00
Aaron Patterson
3e56758a95 add a migrate class method and delegate to the new instance 2011-08-02 20:03:15 -07:00
Christopher Meiklejohn
96fc0746fb Ensure that .up and .down work as well. 2011-08-02 20:03:11 -07:00
Christopher Meiklejohn
55eadccfbf Support backwards compatible interface for migration down/up with rails 3.0.x. 2011-08-02 20:03:06 -07:00
Arun Agrawal
3248c5d5c7 skiping magic comment test. checking encoding_aware?
Loading AS encoding.
2011-07-31 16:03:59 +00:00
Jon Leighton
048215a193 Revert "Replace inline lambdas with named methods" and "Don't wrap operations on collection associations in transactions when they are not needed, so the connection adapter does not send empty BEGIN COMMIT transactions blocks to the database."
This reverts commits df63c99f06 and b17fd25a2d.

The change had unintended side effects, please see #2337.

Conflicts:

	activerecord/test/cases/associations/has_many_associations_test.rb
2011-07-30 23:05:20 +01:00
Aaron Patterson
d13df74c33 default writing the schema file as utf-8 2011-07-29 12:28:21 -07:00
Aaron Patterson
4e1f6ab6f6 dump IO encoding value along with schema.rb so the file can be reloaded. fixes #1592 2011-07-29 12:23:58 -07:00
Jon Leighton
e13e25dda5 Update deprecation messages to point out the availability of proxy_association. Fixes #1148. 2011-07-27 12:44:17 +01:00
Jon Leighton
7bf9b9a170 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.
Conflicts:

	activerecord/lib/active_record/associations/collection_proxy.rb
	activerecord/test/cases/associations_test.rb
2011-07-27 12:41:10 +01:00
Aaron Patterson
a5188333aa bumping to rc5 2011-07-25 16:03:01 -07:00
Aaron Patterson
6dcdcdc696 bumping up arel version 2011-07-25 16:00:54 -07:00
John
12faf8087d Fixed Typo 2011-07-25 23:27:17 +02:00
thedarkone
787194ee43 Bring back the ability to provide :order for update_all. 2011-07-25 16:12:58 +02:00
Oemuer Oezkir
8b30f1d7ea Changed a few instances of of words in the API docs written in British English to
American English(according to Weber)

Conflicts:

	actionpack/lib/action_controller/metal/request_forgery_protection.rb
	railties/lib/rails/engine.rb
2011-07-24 21:10:51 +02:00
Santiago Pastorino
434bbb0efc Revert "Merge pull request #2194 from cldwalker/after_initialize"
This reverts commit 198300727d, reversing
changes made to ae65c0b7a4.
2011-07-23 20:49:42 -03:00
Santiago Pastorino
198300727d Merge pull request #2194 from cldwalker/after_initialize
Fix after_initialize and Base.create edge case
2011-07-23 16:19:33 -07:00
Santiago Pastorino
0988da62e2 Merge pull request #2172 from arunagw/database-rake-1.9.2_3-1-stable
Database rake 1.9.2 3 1 stable
2011-07-23 07:59:02 -07:00
Vijay Dev
ed611fcde6 use simpler words in docs 2011-07-23 12:24:51 +02:00
Gabriel Horner
06c6252b10 simplify and be more explicit about create and after_initialize tests 2011-07-22 20:14:49 -04:00
Les Fletcher
3dc5f71c17 fix after_initialize edge case (close #2074 and close #2175)
fix behavior when after_initialize is defined and a block is passed to Base.create
2011-07-22 20:14:48 -04:00
Aaron Patterson
6f917adf35 forgot to add this test case 2011-07-22 09:15:19 -07:00
Arun Agrawal
8dc4745c7b This conditions is required to work with database create task. 1.9.2 is having a bug with "Calling return within begin still executes else". 2011-07-21 09:53:44 +05:30
Aaron Patterson
9a6b96a61a no need to sort the values 2011-07-20 15:57:45 -07:00
Franck Verrot
1d674d51b9 assign_nested_attributes_for_collection_association should work with Ruby 1.9 [Closes #2106]
Children attributes can be either String's or Symbol's, so let's check if the object responds to to_i.
2011-07-20 15:57:40 -07:00
Aaron Patterson
56fb7fc1b2 bigdecimal should be typecast to a float on sqlite3. fixes #2162 2011-07-20 10:45:16 -07:00
Josh Kalderimis
ff05736947 this fixes a brittle test in fixtures_test.rb which fails when you are in a timezone which is ahead of UTC but UTC is in the previous day still. 2011-07-20 13:10:58 +02:00
Vijay Dev
f78a4e88f6 avoid Symbol#to_proc 2011-07-20 01:07:06 +05:30
Norman Clarke
b8e26e67d7 Explicitly require Active Support dependencies
This fixes errors when using Active Record outside of Rails. In Rails,
these files are required by other classes that are always loaded, so
this error does not happen.

Without core_ext/module/delegation, a NoMethodError is raised because
`delegate` remains undefined.

Without core_ext/class/attribute_acessors, an ArgumentError is raised because
`delegate` does not receive a value for its :to option.
2011-07-19 10:27:57 -03:00
Elliot Winkler
8ebd8416c4 ActiveRecord: Fix eager loading so that giving a blank order clause generates valid SQL 2011-07-18 14:56:07 -06:00
Jon Leighton
312ee12403 Add autoload declaration for deprecated AssociationCollection 2011-07-18 11:58:56 +01:00
Prem Sichanugrist
fa7dd345c3 Refactor test case to use anonymous class - Thank you @tenderlove 2011-07-18 00:35:02 -04:00
Prem Sichanugrist
b2cd66ff9c Show a deprecation warning if user passing less number of argument in the dynamic finder
The previous behavior was unintentional, and some people was relying on it. In the next version of Rails, the dynamic finder will always expecting the number of arguments to be equal or greater (so you can still pass the options to it.) It will raise the ArgumentError otherwise.
2011-07-17 19:30:11 -04:00
Jon Leighton
fb95dee926 Deprecated the AssociationCollection constant 2011-07-16 14:22:34 +01:00
Evan Light
2cbac3c6f8 Closes #2065
Cache key was incorrectly using timezone-dependent record#updated_at when it should be using a timezone-independent value to generate the cache key
2011-07-15 22:11:03 -04:00
Santiago Pastorino
a91afeb42a Merge pull request #2040 from SAP-Oxygen/3-1-stable-sqlbypass-patch
Fix for SqlBypass session store
2011-07-12 15:05:05 -07:00
Joseph Wong
b87f8d8635 Fix for SqlBypass session store
Two issues fixed:
1) connection_pool is not defined - needed by SessionStore#drop_table!
and create_table! since c94651f

2) initialization of connection to the default of AR::Base.connection
only occurred at the singleton level - the instance level method defined
by cattr_accessor did not have this logic
2011-07-12 11:01:56 -07:00
Joseph Wong
63fdd2c90a Fixed session ID fixation for ActiveRecord::SessionStore
I have found that Rails will take an invalid session ID specified by the
client and materialize a session based on that session ID. This means
that it is possible, among other things, for a client to use an
arbitrarily weak session ID or for a client to resurrect a previous used
session ID. In other words, we cannot guarantee that all session IDs are
generated by the server and that they are (statistically) unique through
time.

The fix is to always generate a new session ID in #get_session if an
existing session cannot be found under the incoming session ID.

Also added new tests that make sure that an invalid session ID is never
materialized into a new session, regardless of whether it comes in via a
cookie or a URL parameter (when :cookie_only => false).
2011-07-12 10:57:20 -07:00
Jon Leighton
5c591e5c96 Fix exception if old and new targets are both nil. Fixes #1471.
Conflicts:

	activerecord/test/models/comment.rb
2011-07-12 00:16:44 +01:00
Santiago Pastorino
a7319a9af9 to_key on a destroyed model should return nil 2011-07-09 15:38:08 -03:00
Akira Matsuda
8a4fdbbcd3 formats 2011-07-09 21:35:19 +09:00
Akira Matsuda
7f37ed0152 fix AR having() not to raise NoMethodError when the given argument does not respond to empty?
having raises NoMethodError: undefined method `empty?' when a Fixnum or Date/Time were passed via varargs
2011-07-09 21:35:09 +09:00
Jon Leighton
ca94acf0be Foo.joins(:bar).includes(:bar) should result in a single query with :bar as a join. Related: #1873. 2011-07-09 11:39:38 +01:00