David Heinemeier Hansson
bcf4e4f2b0
Added ActiveRecord::Base#has_secure_password (via ActiveModel::SecurePassword) to encapsulate dead-simple password usage with SHA2 encryption and salting
2010-12-18 13:38:05 -08:00
Santiago Pastorino
3b9120fa52
Generate add_index by default when giving type belongs_to or references
2010-12-16 20:58:58 -02:00
Piotr Sarnacki
40b15f9f38
ActiveRecord::Base.joins should allow single nil argument [ #6181 state:resolved]
2010-12-16 22:25:09 +01:00
Jon Leighton
14b880fd03
Fix various issues with the :primary_key option in :through associations [ #2421 state:resolved]
2010-12-15 17:50:14 -08:00
Jon Leighton
09ddca67ac
Fix problem with duplicated records when a :uniq :through association is preloaded [ #2447 state:resolved]
2010-12-15 17:47:42 -08:00
Aaron Patterson
6bfa846a2c
dry up compute type in attribute
2010-12-15 14:02:30 -08:00
Pavel Gorbokon
96bae30538
Replace rudimentary named_scope with scope. [ #6052 state:resolved]
...
* rename method names (actually in tests)
* rename instance variable @_named_scopes_cache to @_scopes_cache
* rename references in doc comments
* don't touch CHANGELOG :)
2010-12-15 14:02:30 -08:00
Víctor Martínez
fe0db2b805
to_xml doesn't work in such case: Event.select('title as t').to_xml [ #4840 state:resolved]
...
NilClass.type is no longer defined in Ruby 1.9 and causes ActiveRecord::Base.to_xml to fail with message: undefined method `type' for nil:NilClass
2010-12-15 14:02:30 -08:00
Aaron Patterson
4cd3302279
make sure that join nodes are uniq
2010-12-16 01:49:30 +05:30
Jon Leighton
eba7664086
Respect the default_scope on a join model when reading a through association
2010-12-16 01:49:30 +05:30
Ernie Miller
5d37ff6bb2
Fix hm:t to self table aliasing in construct_scope
2010-12-16 01:49:29 +05:30
Aaron Patterson
a64bf22a71
class names are already strings, so we do not need to call to_s on the strings that are already strings
2010-12-16 01:49:29 +05:30
Aaron Patterson
2f0708e974
build SQL AST nodes rather than generate strings
2010-12-16 01:49:29 +05:30
Aaron Patterson
aa4d03fcfc
construct_joins no longer needs an argument
2010-12-16 01:49:29 +05:30
Aaron Patterson
18402b5d64
supporting arel AST nodes when building join statements
2010-12-16 01:49:29 +05:30
Aaron Patterson
80ff64a947
just copy the joins to the list
2010-12-16 01:49:29 +05:30
Aaron Patterson
b68407f7f0
bucketing based on join type
2010-12-16 01:49:29 +05:30
Aaron Patterson
c02fd2acc5
taking advantage of the JoinSource node in the SQL AST
2010-12-16 01:49:29 +05:30
Aaron Patterson
63480d234d
stop delegating inserts to ARel, use the INSERT SQL ourselves
2010-12-16 01:49:29 +05:30
Chiel Wester
bda16eb092
Only call save on belongs_to associations if the record has changed or any nested associations have changed ( resolves #3353 )
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-12-16 01:49:28 +05:30
Aaron Patterson
ad47b7bcc1
just use the regexp directly
2010-12-16 01:49:28 +05:30
Aaron Patterson
59bd9c2a37
combine regexp
2010-12-16 01:49:28 +05:30
Aaron Patterson
b3ae67dbb9
reduce method calls
2010-12-16 01:49:28 +05:30
Aaron Patterson
59ec131555
move ivar to initialize, use triple dot rather than minus
2010-12-16 01:49:28 +05:30
Aaron Patterson
b1447d902c
explicitly set prefix
2010-12-16 01:49:27 +05:30
Aaron Patterson
0042054ea8
remove lasgn since AST is mutated
2010-12-16 01:49:27 +05:30
Aaron Patterson
cea73f82ad
just mutate the ast, fewer lasgns
2010-12-16 01:49:27 +05:30
Xavier Noria
c6612d2bb3
Merge branch 'master' of git://github.com/lifo/docrails
...
Conflicts:
activerecord/lib/active_record/transactions.rb
2010-12-11 00:55:25 +01:00
Xavier Noria
d38644f4a9
reviews commit 53bbbcc
2010-12-11 00:52:33 +01:00
Aaron Patterson
e07772556a
use table alias nodes rather than Table nodes
2010-12-10 13:28:50 -08:00
Aaron Patterson
f528389a55
use alias nodes to represent table aliases
2010-12-10 13:26:58 -08:00
Aaron Patterson
73d4d6704e
avoid *args on join_target_table
2010-12-10 13:20:03 -08:00
Aaron Patterson
6e15a7fa3c
only quote the table name once per call
2010-12-10 11:46:02 -08:00
Aaron Patterson
7d8fd57236
no more manager manipulation if there is no custom join ast
2010-12-10 11:38:43 -08:00
Aaron Patterson
ec72b6b3ec
froms should never equal 0
2010-12-10 11:38:43 -08:00
Aaron Patterson
4dec00a9d8
manager will always be a manager
2010-12-10 11:38:43 -08:00
Aaron Patterson
82944b95a9
eliminate lasgns
2010-12-10 11:38:42 -08:00
Aaron Patterson
88bc49f2f7
dealing with an AST manager, not a relation, so fix the variable names
2010-12-10 11:38:42 -08:00
Piotr Sarnacki
3d01ef6dd1
require core_ext/array/wrap in active_record/migration
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-12-10 08:33:48 +01:00
Aaron Patterson
06ba9eaa62
move join creation a little closer to where it is used
2010-12-09 15:54:07 -08:00
Aaron Patterson
12f67a7069
use inject rather than lasgn
2010-12-09 15:31:09 -08:00
Aaron Patterson
0e8280b193
reuse the superclass methods for shorter codes
2010-12-09 13:48:37 -08:00
Aaron Patterson
b2a042570c
just use core methods
2010-12-09 13:48:37 -08:00
Aaron Patterson
d1387a9942
Merge remote branch 'rude/disable-keys-for-postgres-9.0.1' into pg
...
* rude/disable-keys-for-postgres-9.0.1:
Cleaner way to extract the Postgres version
Fix Bug: disable_referential_integrity doesn't work for postgres 9.0.1
2010-12-09 11:19:25 -08:00
Aaron Patterson
6110b0c54d
fixing documentation, thanks Ivan Evtuhovich
2010-12-09 11:14:54 -08:00
Aaron Patterson
3cbf5d9794
removing useless lasgn
2010-12-09 11:13:00 -08:00
Robert Pankowecki (Gavdi)
bba3dacc3d
Simplifies observer implementation [ #6065 state:resolved]
2010-12-09 10:41:43 -08:00
Piotr Sarnacki
e12810178c
Use Array.wrap instead of using ternary
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-12-09 18:50:49 +01:00
José Valim
cc48192248
Merge remote branch 'drogus/dummy_tasks'
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-12-09 16:09:51 +01:00
Piotr Sarnacki
7b9f634e15
Refactor db:load:config to automatically pick additional migrations if ENGINE_PATH is available
2010-12-09 14:19:32 +01:00