Ken Collins
35d0b6029f
Use existing #empty_insert_statement_value for an insert with no columns.
2011-04-24 12:52:28 -04:00
Josh Kalderimis
f3b9d3aba8
added config.active_record.whitelist_attributes which creates an empty whitelist of attributes available for mass assignment for all models in your app
2011-04-24 09:58:12 +02: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
Xavier Noria
af1b48926f
Merge branch 'master' of git://github.com/lifo/docrails
...
Conflicts:
activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
2011-04-23 01:11:24 +02:00
Xavier Noria
df70b9dfb2
copy-edits 0e2644c
2011-04-23 00:54:20 +02:00
Xavier Noria
ca2f826f5a
copy-edits e2656e0
2011-04-23 00:54:19 +02:00
Xavier Noria
2c50239216
copy-edits 3d45964
2011-04-23 00:54:19 +02:00
Sebastian Martinez
1a7737353f
Added docs for #drop_database on MySQL adapter
2011-04-22 19:44:30 -03:00
Aaron Patterson
5bed6494d4
split indexes and column types on money / binary iteration
2011-04-22 15:41:13 -05:00
Aaron Patterson
3d19b356d7
fetch result row arrays from pg in C and return early if there are no money or binary columns. ❤️
2011-04-22 15:41:13 -05:00
Aaron Patterson
3eae734012
set the backtrace to prevent AR exceptions from lying to us
2011-04-22 15:41:13 -05:00
Aaron Patterson
a37722182f
removing incorrect comment and string concatenation
2011-04-22 12:21:59 -05:00
Pavel Forkert
96acdd3ec4
Added test case and fix for proper eager loading associations
2011-04-22 12:06:15 -05:00
Ken Collins
bc50c1cb02
The #substitute_at gets an ActiveRecord::ConnectionAdapters::Column in #insert to match replacement in #exec_query.
2011-04-23 00:15:33 +08:00
Sebastian Martinez
02ee2003a8
Added docs for #disconnect! on adapters
2011-04-22 12:59:05 -03:00
Sebastian Martinez
0e2644cde0
Added missing docs for clear_cache! on adapters
2011-04-22 12:53:02 -03:00
Sebastian Martinez
e2656e07b9
Added missing docs for +supports_primary_key?+ on some adapters
2011-04-22 12:45:46 -03:00
Sebastian Martinez
3d459645c6
Added missing docs for +support_migrations?+ on some adapters
2011-04-22 12:35:53 -03:00
Sebastian Martinez
00e9cbd78a
Have a more connection specific rdoc for +supports_statement_cache?+
2011-04-22 12:22:53 -03:00
Sebastian Martinez
20002850b3
Removed ON() on distinct comment
2011-04-22 12:14:47 -03:00
Ken Collins
ed2820d6ec
Move #exec_insert to abstract adapter's database statements.
2011-04-22 22:32:55 +08:00
Aaron Patterson
724a786677
stop using distinct on for the unique id queries. [ #6450 state:resolved]
2011-04-21 22:47:13 -05:00
José Valim
30472d4244
Avoid define_method if possible.
2011-04-19 17:58:06 +02: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
b839d40933
Fix test_load_save in test/cases/binary_test.rb (thanks @tenderlove for actually working out how to fix it)
2011-04-17 22:30:27 +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
28146378d3
Bring back some bits of documentation for scopes which were removed as part of the reversion in 256b363
2011-04-17 20:55:24 +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
9951af0289
sort insert columns for better cache hits
2011-04-14 14:26:57 -07:00
Aaron Patterson
12ae92216b
refactoring inserts to use the same method on the connection
2011-04-14 13:37:40 -07:00
Aaron Patterson
0268eac963
mimic prepared statements in the exec_insert for mysql2
2011-04-14 13:37:40 -07: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
8571facea3
insert statements are prepared, but values are not escaped properly
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
Jon Leighton
6b6ecbefad
Extract the constraint-building for joins in JoinAssociation into a separate method to make it easy to change/override (requested by Ernie Miller so that MetaWhere can add to it easily)
2011-04-14 19:34:19 +01:00
Stian Grytøyr
93641ed6c8
Fixes performance issue introduced in 3.0.6 (issue #6695 )
2011-04-14 08:56:02 -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