Prem Sichanugrist
5ca67eca21
Add ActiveRecord::attribute_names to retrieve a list of attribute names. This method will also return an empty array on an abstract class or a model that the table doesn't exists.
2011-05-15 19:07:40 -04:00
knapo
bb498a5749
Fix assigning protected attributes by attributes=
2011-05-11 17:17:42 +02:00
Vishnu Atrai
33f0b6b67d
minor cleaning
2011-05-10 22:51:54 +05:30
Aditya Sanghi
7d0f26796d
Multiparameter POLA, time_select fixes. See LH4346
2011-05-05 15:41:14 +05:30
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
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
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
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
Emilio Tagua
b35617235d
Use IM when trying to load records using ID.
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2011-04-04 10:48:12 +02:00
Sebastian Martinez
245542ea29
Added new #update_column method.
...
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2011-03-27 21:47:38 -03:00
Sebastian Martinez
0e1fed537a
Revert "Removed #update_attribute method. New #update_column method."
...
This reverts commit 45c233ef81 .
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2011-03-27 18:55:30 -03:00
Sebastian Martinez
45c233ef81
Removed #update_attribute method. New #update_column method.
...
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2011-03-26 12:09:04 -03:00
Santiago Pastorino
baa237c974
Allow to read and write AR attributes with non valid identifiers
2011-03-22 20:02:32 -03:00
R.T. Lechow
a1b4d8e7b2
Active Record typos.
2011-03-05 11:56:34 +01:00
Aaron Patterson
f3e9cbc695
use an attribute rather than a SQL literal
2011-02-26 16:05:15 -08:00
Jon Leighton
a7e19b30ca
Add interpolation of association conditions back in, in the form of proc { ... } rather than instance_eval-ing strings
2011-02-14 01:40:31 +00:00
Aaron Patterson
5548e47adb
rawr, mysql, mysql2, why do you hate me. :'(
2011-02-09 13:35:56 -08:00
Aaron Patterson
d3b2596884
use parenthesis so limit works on all dbs
2011-02-09 11:51:09 -08:00
Ken Collins
56fb3b1594
Allow limit values to accept an ARel SQL literal.
2011-02-09 08:33:40 -08:00
Aaron Patterson
5046120b97
comma limits do not make sense on oracle or pg
2011-02-08 16:54:07 -08:00
Aaron Patterson
1c6f4562d7
primary keys should not be cleared on cache clear, fixing oracle tests
2011-02-08 16:01:16 -08:00
Aaron Patterson
0b58a7ff42
limit() should sanitize limit values
...
This fixes CVE-2011-0448
2011-02-08 14:21:12 -08:00
Jan
9643243204
make set_table_name take effect immediately
2011-02-08 10:31:09 -08:00
Aaron Patterson
7423a71fc0
allow AR caches to be cleared, clear them on class reloading
2011-02-03 15:35:44 -08:00
Guillermo Álvarez
351331fb34
Make serialized columns with explicit object_type return a new instance of the object instead of nil
2011-02-03 09:08:45 -08:00
Aaron Patterson
a0fac71922
store the serialized column values in the @attributes hash
2011-02-01 14:25:47 -08:00
Aaron Patterson
ebe485fd8e
serialize can take an arbitrary code object
2011-02-01 14:25:47 -08:00
Jon Leighton
441118458d
Use encode_with for marshalling
2011-01-07 15:03:15 -08:00
Pratik Naik
fd1cf13f74
Make serialized fixtures work again
2010-12-29 16:15:45 +00:00
Aaron Patterson
ec13305b21
stop redifining methods on every call to set_primary_key
2010-12-24 22:15:41 -07:00
Aaron Patterson
207f266cca
define_attr_method must serialize nil correctly
2010-12-20 19:47:15 -08:00
Aaron Patterson
099a210c83
if there is no base name, we cannot determine a primary key
2010-12-20 19:47:15 -08:00
Aditya Sanghi
7a237d56aa
Ensure that boolean false is properly serialized [ #6079 state:resolved]
2010-12-08 15:51:47 -08:00
Aaron Patterson
064c28d6c2
fixing dup regressions
2010-11-23 14:29:05 -08:00
Aaron Patterson
93d78b8318
fixing more dup tests
2010-11-23 14:29:05 -08:00
Aaron Patterson
ca7b0a0d1a
dup is working better
2010-11-23 14:29:03 -08:00
Aaron Patterson
2738ec891b
removing many unused variables
2010-11-16 17:06:50 -08:00
Santiago Pastorino
4718d097ff
Models should be equals even after destroyed
...
[#5978 state:committed]
2010-11-16 12:40:40 -02:00
David Chelimsky
1f06652a57
use persisted? instead of new_record? wherever possible
...
- persisted? is the API defined in ActiveModel
- makes it easier for extension libraries to conform to ActiveModel APIs
without concern for whether the extended object is specifically
ActiveRecord
[#5927 state:committed]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2010-11-09 13:54:04 -02:00
Pratik Naik
c5c2e4fefd
Add timestamps to Topic
2010-11-02 01:24:31 +00:00
Aaron Patterson
410114e85a
adding a test to ensure offsets with no limits will work [ #5316 state:resolved]
2010-10-20 17:17:22 -07:00
Jan
21beedf1ff
default scope merge where clauses [ #5488 state:resolved]
2010-10-20 09:00:36 -07:00
Aaron Patterson
dc76e3c38f
should sort these ids before asserting they are equal!
2010-10-15 15:47:09 -07:00
Aaron Patterson
552636c652
testing that symbols work as sql literals
2010-10-15 15:46:13 -07:00
Aaron Patterson
f22b40a8f2
make sure we use the engine assigned to the table when quoting
2010-09-27 14:29:07 -07:00
Aaron Patterson
e1b51955f1
adding a test for slug behavior
2010-09-27 11:33:35 -07:00
Aaron Patterson
afdf86e8ee
Hash#to_s behaves differently between 1.8 and 1.9, so adjust accordingly
2010-09-23 08:48:10 -07:00
Aaron Patterson
0a515dc68d
testing poor behavior of hash serialization
2010-09-22 14:58:29 -07:00
Emilio Tagua
d64a09b443
Remove helper methods that were moved to helper.rb
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-09-21 15:18:12 +02:00