Commit Graph

979 Commits

Author SHA1 Message Date
Sebastian Martinez
2470392e89 Add doc to #attribute_names 2011-05-15 21:33:49 -03:00
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
Corin Langosch
2bfeda3f09 fix bug in usage example of #unscoped 2011-05-11 09:19:12 +02:00
José Valim
9e4b715d79 Ensure assign_attributes and update_attributes do not fail on nil, closes #478. 2011-05-10 10:30:27 +02:00
Josh Kalderimis
b2451f4a7f renamed mass-assignment scopes to roles, updated code, tests, docs and security guide 2011-05-08 16:43:29 +02:00
José Valim
ba23bf43f2 Class.new.name returns an empty string on 1.8 2011-05-07 17:46:44 +02:00
José Valim
5d6c8d5e9d Revert "Revert the merge because tests did not pass."
This reverts commit 886818d2ba.
2011-05-07 17:33:40 +02:00
José Valim
886818d2ba Revert the merge because tests did not pass.
Revert "Merge pull request #423 from richardiux/master"

This reverts commit b8f08c4ea7, reversing
changes made to fd9df1b1dd.
2011-05-06 23:17:43 +02:00
José Valim
b8f08c4ea7 Merge pull request #423 from richardiux/master
Identity Map caching bug
2011-05-06 14:07:24 -07:00
Richard Millan
fc2823a85c Adding base method symbolized_sti_name to activerecord base to be used on identity map. Identity map now considers the inheritance when creating the caching keys 2011-05-06 10:05:43 -07:00
Aditya Sanghi
7d0f26796d Multiparameter POLA, time_select fixes. See LH4346 2011-05-05 15:41:14 +05:30
Xavier Noria
cea3b3cc9d Merge branch 'master' of git://github.com/lifo/docrails 2011-05-04 14:51:04 +02:00
Sebastian Martinez
04d37b077b Remove extra whitespaces 2011-05-02 10:37:34 -03: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
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
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
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
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
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
Andrew White
a9dafbb28d Delegate first!, last!, any? and many? to scoped 2011-03-29 17:21:21 +01:00
Sebastian Martinez
fb21511040 Bring #reorder back
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-03-28 10:24:08 -03:00
Santiago Pastorino
da6c7bd4b4 Do not in place modify what table_name returns 2011-03-22 19:36:16 -03:00
Jon Leighton
28ed10d3f2 Merge branch 'master' into nested_has_many_through
Conflicts:
	activerecord/CHANGELOG
2011-03-05 22:58:48 +00:00
Jon Leighton
b7f1b3641a Use Base#type_condition in JoinAssociation 2011-03-05 22:32:49 +00:00
Aaron Patterson
74818a3543 use Arel::Table#alias rather than passing the :as parameter 2011-03-05 11:56:24 -08:00
mjy
045ca30394 fixes a missmatched column in example 2011-03-05 11:56:33 +01:00
Jon Leighton
d90b4e2615 Rewrote AssociationPreload. 2011-02-28 22:12:34 +00:00
Josep M. Bach
55105c4318 Fix missing inheritance from AR::Base in docs 2011-02-24 10:00:09 +01:00
Xavier Noria
f41bf6938f merges docrails 2011-02-18 23:22:15 +01:00
Xavier Noria
2acb5e348d removes unrealistic example (authentication plus gender?), that it is not needed anyway 2011-02-18 22:54:02 +01:00
Nicholas Rowe
ad3e4e3af6 Clarify Example in ActiveRecord base 2011-02-18 14:43:53 -05:00
Emilio Tagua
8ee0b44148 Merge remote branch 'rails/master' into identity_map
Conflicts:
	activerecord/examples/performance.rb
	activerecord/lib/active_record/association_preload.rb
	activerecord/lib/active_record/associations.rb
	activerecord/lib/active_record/associations/association_proxy.rb
	activerecord/lib/active_record/autosave_association.rb
	activerecord/lib/active_record/base.rb
	activerecord/lib/active_record/nested_attributes.rb
	activerecord/test/cases/relations_test.rb
2011-02-15 12:01:04 -03: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
Raimonds Simanovskis
c567ccbb17 bugfix for serialized_attributes to be class specific
previously serialized_attributes were kept as class attribute of ActiveRecord::Base - if some attribute was defined as serialized in one subclass then it was serialized in all other subclasses as well (if it had the same name)
2011-02-09 09:19:56 -08:00
Jan
9643243204 make set_table_name take effect immediately 2011-02-08 10:31:09 -08:00
Aaron Patterson
c94651f8c8 almost fisted 2011-02-04 18:14:59 -08:00
Aaron Patterson
7423a71fc0 allow AR caches to be cleared, clear them on class reloading 2011-02-03 15:35:44 -08:00
Aaron Patterson
23a3ba4260 Revert "ARel only requires the connection from the AR class. Simply return the AR class rather than jump through hoops and store ivars"
This reverts commit d65e3b481e.
2011-02-03 14:04:21 -08:00
Aaron Patterson
d65e3b481e ARel only requires the connection from the AR class. Simply return the AR class rather than jump through hoops and store ivars 2011-02-03 11:50:43 -08:00
Aaron Patterson
1a15fda021 reduce cache misses on STI subclasses 2011-02-03 11:12:07 -08:00
Aaron Patterson
a5d8f0be00 this method should be private 2011-02-03 09:09:27 -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
Xavier Noria
a96a9a4948 Merge branch 'master' of git://github.com/lifo/docrails 2011-02-02 22:04:11 +01:00
Franck Verrot
8dcacd0cc7 Refactor clear_timestamp_attributes to use the newly created all_timestamp_attributes_in_model
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-02-02 12:45:25 -02:00
Aaron Patterson
5b42e96602 make sure de-serialization happens on object instantiation 2011-02-01 15:23:55 -08:00
Aaron Patterson
a0fac71922 store the serialized column values in the @attributes hash 2011-02-01 14:25:47 -08:00