Aaron Patterson
9e16254b46
reduce method calls
2010-12-10 16:31:09 -08:00
Aaron Patterson
8924018d59
move ivar to initialize, use triple dot rather than minus
2010-12-10 16:31:09 -08:00
Aaron Patterson
64ba043544
explicitly set prefix
2010-12-10 16:31:08 -08:00
Aaron Patterson
4d5f9a0765
remove lasgn since AST is mutated
2010-12-10 16:31:08 -08:00
Aaron Patterson
b9bb240a2b
just mutate the ast, fewer lasgns
2010-12-10 16:31:08 -08:00
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
3e7c351b48
preheating cache so that tests can run in isolation
2010-12-09 15:12:48 -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
Piotr Sarnacki
6f8958277b
Fix test on finding migrations from 2 paths
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-12-09 18:50:44 +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
Mike Dvorkin
f572a02b94
Take into account current time zone when serializing datetime values [ #6096 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-12-09 09:01:49 +01:00
Aaron Patterson
07b0e59988
use sort_by
2010-12-08 17:31:20 -08:00
Piotr Sarnacki
5df72a238e
Rake tasks for managing database while development and testing of engines
...
Some of the engines needs database. As engine needs to be run inside
Rails application, migrations and other database operations are run
from dummy application. To make that process simple I changed db
tasks to look for migrations in both engine's and application's
db/migrate directory. You can run all of the database tasks from
test/dummy or directly from engine with prefix app, like:
rake app:db:migrate
rake app:db:migrate:redo
2010-12-09 01:59:54 +01:00
Aditya Sanghi
7a237d56aa
Ensure that boolean false is properly serialized [ #6079 state:resolved]
2010-12-08 15:51:47 -08:00
Aaron Patterson
285f456391
updating CHANGELOG
2010-12-08 15:38:39 -08:00
Aaron Patterson
6c5b734e6a
removing method to prevent warnings
2010-12-08 15:37:13 -08:00
Jeff Dean
7ecee054a3
Setting the id of a belongs_to object updates all referenced objects [ #2989 state:resolved]
2010-12-08 15:21:18 -08:00
Piotr Sarnacki
23ba7e456d
properly load database config in database rake tasks, to properly set migrations_paths
2010-12-09 00:04:36 +01:00
Piotr Sarnacki
c9d23214ae
Allow to run migrations from more than one directory in rake tasks
2010-12-09 00:04:36 +01:00
Piotr Sarnacki
d0467e08e5
Allow to run migrations from more than one directory
2010-12-09 00:04:36 +01:00
Aaron Patterson
e924814b28
just allocate the table in initialize
2010-12-08 14:14:14 -08:00
Ivan Evtukhovich
53bbbcc663
Fix doc about nested transaction rollback
...
Because AR::Rollback do not reraise and inner transaction is not "real"
nothing rollback at all
2010-12-09 00:41:47 +03:00
Aaron Patterson
45ea60eee7
fewer method calls, fewer code branches
2010-12-08 12:11:43 -08:00
Aaron Patterson
c69bd59a9c
only call active_record once
2010-12-08 12:09:00 -08:00
Aaron Patterson
dcc0c9a8bb
dry up calls to table_aliases
2010-12-08 12:05:02 -08:00
Aaron Patterson
de4bd472c3
remove code that could never be executed
2010-12-08 11:54:45 -08:00
Aaron Patterson
b8d57a0400
have table_aliases call count_aliases to set the default value
2010-12-08 11:50:16 -08:00
Aaron Patterson
f4223cc7ab
arel ignores the columns parameter
2010-12-08 11:18:26 -08:00
Aaron Patterson
17d72dd19f
adding a fixme comment
2010-12-08 11:02:15 -08:00
Aaron Patterson
3499f882cc
renaming variables, making the join_ast method private
2010-12-08 10:54:24 -08:00
Aaron Patterson
ddd6dee043
further reducing dependence on custom_joins
2010-12-08 10:35:26 -08:00
Aaron Patterson
2fd385d471
reducing use of custom joins
2010-12-08 10:29:52 -08:00
Aaron Patterson
1d96d44da3
passing the ast to a table when the relation is a table
2010-12-07 18:54:04 -08:00
Aaron Patterson
d98cb5153d
JoinDependency is always created with an AST now
2010-12-07 17:05:15 -08:00
Aaron Patterson
2d9d6cd4c2
passing the ast to JoinDependency
2010-12-07 16:48:59 -08:00
Aaron Patterson
d6133209ce
arel is lazy about column information, so no need to pass it around
2010-12-07 15:25:16 -08:00
Aaron Patterson
ddbd203961
reduce string objects, reduce method calls
2010-12-07 15:25:16 -08:00
Aaron Patterson
ef79658bd1
save the AR reference rather than delegating
2010-12-07 14:47:21 -08:00
Aaron Patterson
70ab450274
cleaning up custom_join_sql method
2010-12-07 14:01:37 -08:00
Santiago Pastorino
20ba81e47d
We can use the keys of the @attributes hash here and avoid a method call
2010-12-05 12:44:17 -02:00
Santiago Pastorino
c4809d9984
use map instead of each
2010-12-05 12:44:14 -02:00
Santiago Pastorino
a11ddf3ee2
Fix indentation here
2010-12-04 17:50:02 -02:00
Santiago Pastorino
3e84255942
attributes_before_type_cast are just the value of @attributes
2010-12-04 17:49:37 -02:00
Aaron Patterson
a299fcaef9
not a responsibility for rails to test
2010-12-03 16:22:42 -08:00
Aaron Patterson
d21f38aaa2
use the columns hash for primary key lookup
2010-12-03 15:33:59 -08:00
Aaron Patterson
399730bdd2
removing unused setup
2010-12-03 12:00:09 -08:00
Aaron Patterson
47737681fd
in the middle of refactoring
2010-12-03 12:00:09 -08:00
Aaron Patterson
9a3e29e126
remove calls to deprecated methods
2010-12-02 15:56:55 -08:00
Aaron Patterson
b0fc912f1b
avoid deprecate api
2010-12-02 15:50:34 -08:00
Aaron Patterson
8c9b5e413f
removing more calls to deprecated methods
2010-12-02 15:07:01 -08:00
Aaron Patterson
ead0c6eed3
removing more calls to deprecated methods
2010-12-02 15:07:00 -08:00
Aaron Patterson
12b9920a15
removing calls to deprecated methods
2010-12-02 15:07:00 -08:00
Aaron Patterson
9f0133fbf4
refactor `self.class` to a variable
2010-12-02 15:07:00 -08:00
Santiago Pastorino
21eadc1b3f
Base#[] and Base#[]= are aliases so implement them as aliases :)
2010-12-02 20:28:28 -02:00
Santiago Pastorino
42c51b8527
Doesn't need to sort, lets users of attribute_names sort them if they want
2010-12-02 20:28:24 -02:00
Aaron Patterson
6673d88f6f
avoiding deprecated methods in arel
2010-12-02 14:02:52 -08:00
Aaron Patterson
15633519f7
removing some calls to insert on arel
2010-12-02 14:02:52 -08:00
Alex Rothenberg
deb90d9485
made in_clause_length default nil (no limit)
2010-12-02 08:53:19 -08:00
Aaron Patterson
077ec5a0ed
fixing space errors
2010-12-02 08:45:37 -08:00
Aaron Patterson
da6ce2e253
adding a test for YAML round trip
2010-12-02 08:44:48 -08:00
Michael Koziarski
96eec090df
Work around a strange piece of Syck behaviour where it checks Model#respond_to? before initializing the object.
...
Things like YAML.load(YAML.dump(@post)) won't work without this.
2010-12-02 08:40:34 -08:00
Aaron Patterson
0afebd5b31
no need for self
2010-12-01 18:00:24 -08:00
Aaron Patterson
3ec212e3c9
rolling out migrated_at until I can fix the build
2010-12-01 17:08:01 -08:00
Aaron Patterson
c15c14563e
removing duplicate test
2010-12-01 15:14:56 -08:00
Aaron Patterson
85a5318c2b
should not to_s the possibly nil value
2010-12-01 15:14:10 -08:00
Aaron Patterson
4232454289
make sure we have a value in migrated_at
2010-12-01 15:07:44 -08:00
Aaron Patterson
7d2179608c
not all databases return dates as strings
2010-12-01 14:59:17 -08:00
Aaron Patterson
754493c790
updating CHANGELOG
2010-12-01 14:35:57 -08:00
Aaron Patterson
c266a6bf0f
fixing tests and warnings
2010-12-01 14:33:59 -08:00
Josh Susser
a49de9811a
tests mostly pass
...
adjust to work with instance-based migations
migrated_at can't be null
why must people have last names? it's killing me!
2010-12-01 12:01:56 -08:00
Josh Susser
b07c2c0fd3
clear schema_migrations in Schema.define
2010-12-01 11:01:15 -08:00
Josh Susser
7139aa878c
name in schema_migrations, migrations in schema dump
2010-12-01 10:57:38 -08:00
Josh Susser
4e4e9ad48a
record migration timestamp when migrations run
2010-12-01 10:46:29 -08:00
Josh Susser
c283cdd63c
Add migrated_at column to schema_migrations table.
2010-12-01 10:46:29 -08:00
Aaron Patterson
542cb5c327
fix warnings, stop using global variables
2010-11-30 18:46:56 -08:00
Aaron Patterson
10b1887a71
JoinBase initialize can be deleted
2010-11-30 17:48:10 -08:00
Aaron Patterson
d51854a6be
stop using splat args when we do not need them
2010-11-30 17:42:17 -08:00
Aaron Patterson
7408b6ec84
just grep the AST for OuterJoin nodes rather than converting the tree to SQL
2010-11-30 17:29:19 -08:00
Aaron Patterson
f1758525f9
reduce method calls on arel
2010-11-30 16:51:03 -08:00
Aaron Patterson
39f5fc06cb
just call join_sql against the manager object
2010-11-30 16:42:21 -08:00
Aaron Patterson
22b01c52c7
isolating eager_loading? method
2010-11-30 16:10:49 -08:00
Aaron Patterson
fe522f79c7
we already know it is already an array, so we do not need to make really really sure it is an array
2010-11-30 15:53:04 -08:00
Aaron Patterson
ae6033331f
shorten up scope_for_create
2010-11-30 15:48:15 -08:00
Aaron Patterson
b293ab7c61
making sure scope_for_create value is cached
2010-11-30 15:45:32 -08:00
Aaron Patterson
b2e7d1e41e
surrounding scope_for_create behavior
2010-11-30 15:44:30 -08:00
Aaron Patterson
7ff980031b
scope_for_create always returns something
2010-11-30 15:39:49 -08:00
Aaron Patterson
dccf624b64
Ruby 1.8, how does it work?
2010-11-30 15:20:27 -08:00
Aaron Patterson
c856e25b32
removing arel 1.0 compatibility
2010-11-30 14:56:53 -08:00
Aaron Patterson
3ad0779e56
testing combined nodes are not traversed
2010-11-30 14:56:32 -08:00
Aaron Patterson
795dc3d15f
adding more tests surrounding where_values_hash
2010-11-30 14:47:55 -08:00
Aaron Patterson
6c32290bac
testing Relation#table_name
2010-11-30 14:29:35 -08:00
Aaron Patterson
bfc398cb70
adding a test for ActiveRecord::Relation
2010-11-30 14:10:55 -08:00
Aaron Patterson
b7a9890d77
fix whitespace errors
2010-11-30 13:38:48 -08:00
Aaron Patterson
8998aea4b7
making relationship merge cheaper
2010-11-30 13:31:00 -08:00
Aaron Patterson
b6848b6491
cleaning up where_values_hash
2010-11-30 12:05:02 -08:00
Aaron Patterson
76a15dd059
adding more tests surrounding where values hash
2010-11-29 16:41:02 -08:00
Aaron Patterson
9f2e885ce8
testing attributes applied by default_scope
2010-11-29 13:32:02 -08:00
Aaron Patterson
aae3c35384
removing interpolate_sql from join associations
2010-11-29 10:58:21 -08:00
Aaron Patterson
439a7dc0e6
moving method to subclass that actually uses the method
2010-11-29 10:39:33 -08:00
John Hawthorn
28896a9f4a
test case on has_one :through after a destroy
...
[#6037 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-11-29 10:48:48 +01:00
José Valim
e444439fe2
Partialy revert f1c13b0dd7
2010-11-28 16:55:53 +01:00
Xavier Noria
9332cc582e
removes a couple of redundant selfs
2010-11-26 00:35:23 +01:00
Santiago Pastorino
438c0188f8
nil check unneeded ht. exviva
2010-11-25 20:00:40 -02:00
Emilio Tagua
a3bd62e1ba
Remove explicit return.
...
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-11-25 17:35:24 -02:00
Emilio Tagua
c91a13f8f5
Use ternary instead explicit return.
...
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-11-25 17:35:09 -02:00
Emilio Tagua
ac6e9447e5
Remove return, we are already returning self.
...
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-11-25 17:33:38 -02:00
Emilio Tagua
1b6b80355c
Remove explicit return.
...
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-11-25 17:33:18 -02:00
Emilio Tagua
c4d31d0f13
Reuse lock_col variable instead calling locking_column class method.
...
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-11-25 17:32:16 -02:00
raggi
cb1570936d
Rakefiles are executables, and rake loads rake, not rakefile code
2010-11-25 06:49:55 +08:00
raggi
d8692985fe
Don't depend on rubygems loading thread (for Mutex)
2010-11-25 06:47:27 +08:00
Aaron Patterson
ee74f2c623
alias should be a SQL literal
2010-11-24 14:16:38 -08:00
Aaron Patterson
38eb01863c
initialize instance variables in initialize... o_O
2010-11-24 14:11:12 -08:00
Aaron Patterson
34d21b87bb
adding a factory method to the join part for generating a table alias
2010-11-24 13:55:56 -08:00
Aaron Patterson
cdf6cf01cb
use ARel rather than generate SQL strings
2010-11-24 13:55:55 -08:00
Aaron Patterson
afe51afcc6
remove useless join
2010-11-24 13:55:55 -08:00
Aaron Patterson
d4b8d3bafa
moving column_aliases to JoinDependency
2010-11-24 13:55:55 -08:00
Aaron Patterson
a3ba60fd81
reduce method calls
2010-11-24 13:54:08 -08:00
Neeraj Singh
66212f69ac
If a nested_attribute is being marked for destruction and at the same time an attr_accessor value is being assigned then the value being assigned is being ignored. This patch is a fix for that issue.
...
[#5939 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-11-24 22:08:36 +01:00
Franck Verrot
7f8ce38b0d
Document the behavior of the dup method: does not preserve timestamps
2010-11-25 03:01:30 +08:00
Franck Verrot
7b77a1fc71
Typo in the comments of the clear_timestamp_attributes method
2010-11-25 03:01:30 +08:00
Franck Verrot
c17cb7326d
Dup should reset the timestamps as it is considered a new record
2010-11-25 01:18:43 +08:00
Franck Verrot
47f39d26a7
Testing that dup is resetting the timestamps
2010-11-25 01:18:43 +08:00
Aaron Patterson
0687b21de8
removing ternary
2010-11-23 17:52:51 -08:00
Aaron Patterson
1aaa8edeb9
breaking classes up in to respective files
2010-11-23 17:42:49 -08:00
Aaron Patterson
a551d2ec62
fixing variable names. oops!
2010-11-23 17:42:49 -08:00
Aaron Patterson
8e8fb8a429
just wrap as a sql literal
2010-11-23 14:42:55 -08:00
Neeraj Singh
d33dcba72d
Do not send id for quoting twice if the primary key is string.
...
[#6022 state:resolved]
2010-11-23 14:33:00 -08:00
Aaron Patterson
0456feab11
updating changelog for dup and clone semantics
2010-11-23 14:29:05 -08:00
Aaron Patterson
d717cb2913
clone and dup are working on 1.8
2010-11-23 14:29:05 -08:00
Aaron Patterson
fe4388eb15
converting clone test to dup test
2010-11-23 14:29:05 -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
6a8f1b8b40
renaming duplication test to dup test
2010-11-23 14:29:04 -08:00
Aaron Patterson
c5858a6df3
adding a specific case for clone testing
2010-11-23 14:29:04 -08:00
Aaron Patterson
28f4df0908
testing duped attributes are independent
2010-11-23 14:29:04 -08:00
Aaron Patterson
4c1f76eaab
initialize_clone can go away
2010-11-23 14:29:04 -08:00
Aaron Patterson
035d00b665
making sure changes to dup will not touch original
2010-11-23 14:29:04 -08:00
Aaron Patterson
5badf60d12
dup keeps changes
2010-11-23 14:29:04 -08:00
Aaron Patterson
ca7b0a0d1a
dup is working better
2010-11-23 14:29:03 -08:00
Xavier Noria
85d64316a4
Merge branch 'master' of git://github.com/lifo/docrails
2010-11-23 21:59:50 +01:00
Emilio Tagua
9f35799221
Refactor && simplify count_records.
2010-11-23 09:51:07 -08:00
Emilio Tagua
e2bad8a2e7
No need to create a variables to use them once.
2010-11-24 01:37:02 +08:00
Emilio Tagua
d29d793c90
Don't create local vars.
2010-11-24 01:37:01 +08:00
Emilio Tagua
6ffe0ef55b
Avoid creating local var.
2010-11-24 01:37:01 +08:00
Emilio Tagua
63c9185b62
Remove explicit return and avoid creating local var.
2010-11-24 01:37:01 +08:00
Emilio Tagua
1b531b7ee2
Remove explicit return.
2010-11-24 01:37:00 +08:00
Emilio Tagua
b8df3a9197
Use params default.
2010-11-24 01:37:00 +08:00
Emilio Tagua
861cdc4c59
Remove unneeded local var.
2010-11-24 01:36:59 +08:00
Emilio Tagua
9c161599ac
Remove uneeded local var definition.
2010-11-24 01:36:59 +08:00
Emilio Tagua
a9e963d51d
Remove confusing parenthesis.
2010-11-24 01:36:59 +08:00
Emilio Tagua
14055ea282
No need to define a local var here.
2010-11-24 01:36:59 +08:00
Ray Baxter
de829f871b
fix typo
2010-11-22 22:11:56 -08:00
Aaron Patterson
dc320d5873
skip cloning if arguments are blank
2010-11-22 17:23:37 -08:00
Aaron Patterson
4ece7e06fd
removing space error
2010-11-22 17:06:55 -08:00
Aaron Patterson
4d31ee1e0e
removing unused variables
2010-11-22 16:14:37 -08:00
Alex Rothenberg
66c09372f3
Removed ids_in_list_limit in favor of in_clause_length defined in database_limits.rb
2010-11-23 06:43:18 +08:00
Neeraj Singh
5debc65c35
Merge branch 'master' of github.com:lifo/docrails
2010-11-22 17:32:27 -05:00
Neeraj Singh
1c68e55ae5
Revert "unscoped takes care of named_scopes too"
...
This reverts commit 126fbd7ed8
.
2010-11-22 17:32:15 -05:00
Matthew Rudy Jacobs
16d7ba0698
Cleaner way to extract the Postgres version
2010-11-21 20:45:01 +08:00
Neeraj Singh
c8ab3992f8
unscoped takes care of named_scopes too
2010-11-21 03:29:43 +01:00
Josh Kalderimis
8796f9a31a
removed an AR method which wasn't used internally, had no tests, and had no docs
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-11-20 19:40:32 +01:00
Josh Kalderimis
d7db6a8873
class inheritable attributes is used no more! all internal use of class inheritable has been changed to class_attribute. class inheritable attributes has been deprecated.
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-11-20 19:40:29 +01:00
Matthew Rudy Jacobs
d9ac62c914
Fix Bug: disable_referential_integrity doesn't work for postgres 9.0.1
2010-11-21 00:18:33 +08:00
Aaron Patterson
938243feb9
do not require ruby-debug automatically. please require it if you have declared it as a dependency
2010-11-19 16:26:09 -08:00
Aaron Patterson
6bd93f672a
wtf vim
2010-11-19 11:48:23 -08:00
Aaron Patterson
598fc85f9e
fisting typeo, thanks @vinibaggio
2010-11-19 11:42:58 -08:00
Aaron Patterson
a4d9b1d329
adding documentation for reversible migrations
2010-11-19 11:34:42 -08:00
Aaron Patterson
db32b545da
adding Migration#change to the CHANGELOG
2010-11-19 11:20:02 -08:00
Aaron Patterson
87124457e5
fisting my spelling errors
2010-11-19 10:55:57 -08:00
Aaron Patterson
0cc6c46fe9
testing a non-invertible migration case
2010-11-19 10:50:24 -08:00
Aaron Patterson
47017bd169
invertable migrations are working
2010-11-19 10:31:03 -08:00
Aaron Patterson
6519df4157
command recorder will record commands sent to a delegate object
2010-11-19 10:24:16 -08:00
Aaron Patterson
6dbbfae563
adding invertable migration test
2010-11-19 10:24:16 -08:00
Aaron Patterson
0d7410faab
updating documentation
2010-11-19 10:24:16 -08:00
Aaron Patterson
96b50a0392
IrreversibleMigration is raised if we cannot invert the command
2010-11-19 10:24:15 -08:00
Aaron Patterson
b29a24bb6f
commands are reversed
2010-11-19 10:24:15 -08:00
Aaron Patterson
5d93900dc6
add and remove timestamps can be inverted
2010-11-19 10:24:15 -08:00
Aaron Patterson
24b637a80f
inverting add_index
2010-11-19 10:24:15 -08:00
Aaron Patterson
843e319f78
partial implementation of the command recorder
2010-11-19 10:24:15 -08:00
Aaron Patterson
24174d1b3a
this return value is not used, so stop returning it
2010-11-19 10:23:13 -08:00
Aaron Patterson
9280fbf795
instantiate the delegate object after initialize is defined so that our initialize method actually gets called
2010-11-19 10:14:13 -08:00
Aaron Patterson
07a74f196d
connection is set from the connection pool during migrations
2010-11-18 15:53:59 -08:00
Aaron Patterson
e107dcca6b
testing multiple ORd queries
2010-11-18 13:39:57 -08:00
Aaron Patterson
26923756fb
removing space errors
2010-11-18 10:01:29 -08:00
Alex Rothenberg
c5a284f8eb
Adapters can specify maximum number of ids they support in a list of expressions
...
(default is nil meaning unlimited but Oracle imposes a limit of 1000)
Limit is used to make multiple queries when preloading associated has_many or habtm records
2010-11-18 09:59:52 -08:00
Neeraj Singh
126fbd7ed8
unscoped takes care of named_scopes too
2010-11-17 21:46:55 -05:00
Aaron Patterson
80d9b724c3
group can be done by left side only
2010-11-17 17:28:40 -08:00
Santiago Pastorino
c6bfd6802a
When use where more than once on the same column, relation doesn't do an 'or' or 'in' with the values
2010-11-17 17:15:25 -08:00
Aaron Patterson
00693209ec
collapsing same table / column WHERE clauses to be OR [ #4598 state:resolved]
2010-11-17 17:10:50 -08:00
Aaron Patterson
56c5820458
use shorter form for sql literals
2010-11-17 16:15:52 -08:00
Jon Leighton
fe42c00ac3
Fix bug with 0bb85ed9ff
which missed out a fixtures declaration in cascaded_eager_loading_test.rb
2010-11-17 15:52:18 -08:00
Neeraj Singh
9c1993bf6b
replace and with && as per rails coding convention
2010-11-18 07:49:45 +08:00
Neeraj Singh
f978c4b2e4
remove the rescue block by returning a not asking Base for lookup_ancestors. It was also marked for later optimization.
2010-11-17 15:44:04 -08:00
Aaron Patterson
43e2e10f4f
adding an initialize with name and version defaults
2010-11-17 15:30:09 -08:00
Aaron Patterson
4d35f8b661
updating generators
2010-11-17 14:57:54 -08:00
Aaron Patterson
c1a63c8dba
fixing more documentation
2010-11-17 14:57:54 -08:00
Aaron Patterson
d1fcba8118
fixing documentation, removing unused AS files
2010-11-17 14:57:54 -08:00
Aaron Patterson
7906e08bba
fixing indentation since these methods are not class methods
2010-11-17 14:57:54 -08:00
Aaron Patterson
606e41a4dd
these methods are no longer needed
2010-11-17 14:57:54 -08:00
Aaron Patterson
17c7723451
updating CHANGELOG
2010-11-17 14:26:35 -08:00
Aaron Patterson
b0a6f58068
do not need these accessors
2010-11-17 14:26:35 -08:00
Aaron Patterson
68b66ef308
testing instance based migrations
2010-11-17 14:26:35 -08:00
Aaron Patterson
974ff0dd43
singleton method added is no longer needed
2010-11-17 14:26:35 -08:00
Aaron Patterson
0bea9fd6be
schema migrations work as instances
2010-11-17 14:26:34 -08:00
Aaron Patterson
8b2f801ed8
converted migrations to support instance methods
2010-11-17 14:26:34 -08:00
Aaron Patterson
77440ec51a
fixing assertions so error messages will be more helpful
2010-11-17 13:02:03 -08:00
Carl Lerche
ccd2f3ede5
Update the version.rb files to include a PRE part
2010-11-16 17:19:46 -08:00
Aaron Patterson
2738ec891b
removing many unused variables
2010-11-16 17:06:50 -08:00
Aaron Patterson
08c64bbd39
super automatically passes on the implicit block
2010-11-16 14:28:19 -08:00
Aaron Patterson
05320e3788
use unless instead of if !
2010-11-16 14:28:19 -08:00
Aaron Patterson
5f608fc7c4
removing space errors
2010-11-16 14:28:19 -08:00
Aaron Patterson
c801f233df
reloading an association will properly set attributes of instantiated objects. Thanks Brian Palmer [ #5802 state:resolved]
2010-11-16 14:28:19 -08:00
Aaron Patterson
59ba800698
refactoring uniq method
2010-11-16 13:34:18 -08:00
Aaron Patterson
7ebd36d1c4
refactor to reduce method calls
2010-11-16 11:43:11 -08:00
Alexandru Catighera
a5cdf0b9eb
Fix ActiveRecord calculations when grouped by multiple fields
2010-11-16 10:38:47 -08:00
Piotr Sarnacki
437ceab139
Create directory before copying migrations if it does not exist
2010-11-16 17:00:01 +01:00
Xavier Noria
a820d0afdd
revises RDoc of AR::Base#==
2010-11-16 15:58:37 +01:00
Santiago Pastorino
4718d097ff
Models should be equals even after destroyed
...
[#5978 state:committed]
2010-11-16 12:40:40 -02:00
Aaron Patterson
ace84a003c
support finding by a ruby class [ #5979 state:resolved]
2010-11-15 20:25:43 -08:00
Aaron Patterson
7bf9cbb766
adding more test coverage around finding with active record objects
2010-11-15 15:30:58 -08:00
Aaron Patterson
dcdfc84f55
use quoted id of single AR::Base objects in predicates
2010-11-15 14:35:38 -08:00
Neeraj Singh
7c5c1a07c0
if association is already loaded and if a find operation is performed on the already loaded association list with an empty hash then do not perform another sql
...
[#5972 state:resolved]
2010-11-15 10:12:23 -08:00
Aaron Patterson
022519a032
fisting a bunch of unused variable warnings
2010-11-15 10:12:09 -08:00
Santiago Pastorino
bc556a21e2
Remove unused var
2010-11-14 15:34:07 -02:00
Jason Cheow
93c9f4a942
Fix bug where size of through association is not correct after adding a has_many association (occurs only before main object has been reloaded).
...
[#5968 state:committed]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-11-14 15:32:52 -02:00
Franck Verrot
983976ec54
Finder gives a little bit more info on the lookup column (primary key)
2010-11-13 06:32:08 +08:00
Santiago Pastorino
b734e192a7
present? is better here
2010-11-11 19:00:33 -02:00
José Valim
f912a359aa
Merge remote branch 'drogus/plugin_new'
...
Conflicts:
railties/test/generators/app_generator_test.rb
2010-11-11 19:39:21 +01:00
Franck Verrot
de2933e1a0
STI type is now updated when calling AR::Base.becomes on subclasses [ #5953 state:resolved]
2010-11-12 02:17:34 +08:00
Santiago Pastorino
296e5c38f1
Use ! instead of not
2010-11-11 15:24:49 -02:00