Aaron Patterson
951e18abea
introduce a body proxy to ensure that query cache is enabled during streaming
2011-05-02 11:30:49 -07:00
Aaron Patterson
4300855e7d
more tests around caching
2011-05-02 11:17:31 -07:00
Aaron Patterson
3066ea8b44
add a couple test cases surrounding query cache middleware
2011-05-02 11:13:49 -07:00
José Valim
3fc37e8ef9
Fix failing AR test.
2011-05-02 10:16:13 +02:00
David Heinemeier Hansson
31155eeb3c
Make the identity map use the instrumentation infrastructure so we can style the messages nicely with colors (FIXME: Can someone look into why the test is not working?)
2011-05-01 19:10:21 -06:00
David Heinemeier Hansson
a8861c8f5b
Merge pull request #357 from joshk/assign_attributes.
...
Assign protected attributes with create/new and control the role.
2011-05-01 16:59:33 -07:00
David Heinemeier Hansson
32ef3ccaa6
Merge pull request #340 from joshk/default_scope_changes.
...
removed the default_scope deprecations and updated the docs and tests to
2011-05-01 16:54:36 -07:00
Josh Kalderimis
86d7ed3375
singular and collection relations in AR can now specify mass-assignment security options (:as and :without_protection) in build, create and create! methods.
2011-05-01 23:30:07 +02:00
Josh Kalderimis
7c5ae0a88f
Added mass-assignment security :as and :without_protection support to AR.new and AR.create
2011-05-01 23:08:50 +02:00
Aaron Patterson
23eb81a3d1
assert_difference can take a callable piece of code rather than just evaling a string
2011-05-01 11:55:13 -07:00
Aaron Patterson
a0656989c4
fixing more test warnings in 1.9.3
2011-04-30 17:40:53 -07:00
Aaron Patterson
9274a5744b
fixing test warnings
2011-04-30 17:37:58 -07:00
Aaron Patterson
7ee5f2eee5
making sure the create_fixtures method works to prevent regressions
2011-04-29 18:21:24 -07:00
Aaron Patterson
850b3ca477
supporting nil when passed in as an IN clause
2011-04-29 11:01:59 -07:00
gmile
66a18855ea
Test that passing nil member of array in conditions retrieves records with nil
...
value on a selected field.
2011-04-29 09:43:18 -07:00
Josh Kalderimis
5164c50d7f
removed the default_scope deprecations and updated the docs and tests to reflect its use cases
2011-04-28 18:46:40 +02:00
Josh Kalderimis
78e581bd2f
some test renaming to avoid collisions, and some annoying issues between dbs
2011-04-27 23:27:10 +02:00
Josh Kalderimis
e85dbd8f06
final corrections to the mass-assignment security tests
2011-04-27 20:57:56 +02:00
Josh Kalderimis
fee69cb021
fix mass-assignment security tests, this was due to a string column limit which doesn't cause issues on sqlite
2011-04-27 00:28:24 +02:00
Josh Kalderimis
bb7024b6ec
AR update_attributes api is updated to reflect the addition of assign_attributes
2011-04-26 18:00:57 +02:00
Aaron Patterson
6e02a61f39
Merged pull request #310 from beanieboi/master.
...
Added support for tsvector datatype in postgres
2011-04-26 08:52:37 -07:00
Benjamin Fritsch
714b4a82f4
Added tsvector Datatype Support
...
Applied Patch from https://rails.lighthouseapp.com/projects/8994/tickets/5577-suport-from-tsvector-data-type-in-postgresql
2011-04-26 09:47:40 +02:00
José Valim
b73c84eaa7
Merged pull request #308 from joshk/assign_attributes.
...
deprecated the use of guard_protected_attributes with attributes= in AR
2011-04-25 23:58:23 -07:00
Josh Kalderimis
f9d5a7bb8c
deprecated the use of the guard_protected_attributes argument with attributes= in AR in favor of assign_attributes(attrs, :without_protection => true)
2011-04-25 23:57:09 +02:00
Raimonds Simanovskis
070c9984a5
Do not use SQL LIKE operator for case insensitive uniqueness validation
...
It can result in wrong results if values contain special % or _ characters. It is safer to use SQL LOWER function and compare for equality.
2011-04-25 22:17:18 +03:00
Josh Kalderimis
a08d04bedf
Added assign_attributes to Active Record which accepts a mass-assignment security scope using the :as option, while also allowing mass-assignment security to be bypassed using :with_protected
2011-04-24 09:53:18 +02:00
Pavel Forkert
96acdd3ec4
Added test case and fix for proper eager loading associations
2011-04-22 12:06:15 -05:00
Jon Leighton
019cd51a3f
Bring back support for passing a callable object to the default_scope macro. You can also just use a block.
2011-04-18 23:35:22 +01:00
Jon Leighton
6f84c73dc4
Un-deprecate using 'default_scope' as a macro, but if you are calling the macro multiple times that will give deprecation warnings, and in 3.2 we will simply overwrite the default scope when you call the macro multiple times.
2011-04-18 23:15:38 +01:00
Jon Leighton
2a5e317951
Fix test_associate_existing in has_many_through_associations_test on mysql and postgresql
2011-04-17 21:58:47 +01:00
Jon Leighton
256b363eee
Revert "Deprecate defining scopes with a callable (lambda, proc, etc) via the scope class method. Just define a class method yourself instead."
...
This reverts commit f0e198bfa1 .
Conflicts:
activerecord/test/models/post.rb
2011-04-17 20:47:52 +01:00
Jason Weathered
0fd0d68962
Bypass IdentityMap in PostgreSQL geometric tests.
...
The identity map cache prevents us from seeing the DB formatted strings.
2011-04-17 23:51:20 +10:00
Jon Leighton
65469a6e5e
Return nil from read_attribute(:foo) if 'foo' is not present in the @attributes hash, but the _foo method has been defined. This brings the behaviour into line with the 3-0-stable branch and the master branch before 93641ed6c8 (there were previously no assertions about this which is why the change slipped through). Note that actually calling the 'foo' method will still raise an error if the attribute is not present.
2011-04-15 13:27:08 +01:00
Jon Leighton
e01dfb27fc
Undo performances regressions I introduced in bbe0a507f2 and add test for an edge case. Add comments to explain the intent of the code.
2011-04-15 13:09:12 +01:00
Jon Leighton
e68a83c9ec
Refactor test to avoid hackery
2011-04-15 02:19:11 +01:00
Jon Leighton
bbe0a507f2
Remove unnecessary code from define_read_method and add assertion to make sure the underscored version is actually generated
2011-04-15 01:44:27 +01:00
Aaron Patterson
a22ceaeefa
mysql type cast should return integers when typecasting true / false
2011-04-14 13:37:39 -07:00
Aaron Patterson
a0d4c8d1bf
using the database adapter to typecast before executing prepared statement
2011-04-14 13:37:39 -07:00
Aaron Patterson
27f8c57f5f
inserting big decimals as strings works consistently among dbs, so use string form
2011-04-14 13:37:39 -07:00
Aaron Patterson
4893170da2
adding a type cast method for prepared statements
2011-04-14 13:37:38 -07:00
Aaron Patterson
1f4dae9daa
do not depend on to_yaml being called, but rather depend on YAML being dumped
2011-04-13 11:41:42 -07:00
Aaron Patterson
eebb19c954
use index based substitution for bind parameters
2011-04-13 09:42:51 -07:00
Prem Sichanugrist
733bfa63f5
Remove #among? from Active Support
...
After a long list of discussion about the performance problem from using varargs and the reason that we can't find a great pair for it, it would be best to remove support for it for now.
It will come back if we can find a good pair for it. For now, Bon Voyage, `#among?`.
2011-04-13 20:25:28 +08:00
Aaron Patterson
1b5b53da5e
common @jonleighton 💣
2011-04-12 20:29:35 -07:00
Jon Leighton
f0e198bfa1
Deprecate defining scopes with a callable (lambda, proc, etc) via the scope class method. Just define a class method yourself instead.
2011-04-12 19:46:05 -07:00
Jon Leighton
788bd30859
ActiveRecord::Base.scopes hash is not needed
2011-04-12 19:46:04 -07:00
Jon Leighton
8572ae6671
Evaluate default scopes at the last possible moment in order to avoid problems with default scopes getting included into other scopes and then being unable to remove the default part via unscoped.
2011-04-12 19:46:04 -07:00
Jon Leighton
5740d4ec0c
Deprecated support for passing hashes and relations to default_scope, in favour of defining a 'default_scope' class method in the model. See the CHANGELOG for more details.
2011-04-12 19:46:04 -07:00
Jon Leighton
fc9a04b6a6
Removing the scope-caching which happens on association proxies, because the query is already cached by the query cacher. For formalised proof see http://www.youtube.com/watch?v=wDefXLb-FDs
2011-04-12 19:46:04 -07:00
David Heinemeier Hansson
d1575ae1b9
Change Object#either? to Object#among? -- thanks to @jamesarosen for the suggestion!
2011-04-12 00:23:07 +02:00