Aaron Patterson
2faa8bbe11
refactor a couple injects to map + Hash[]
2010-09-08 14:02:47 -07:00
Aaron Patterson
c0c8a04efc
avoid an inject in favor of dup
2010-09-08 13:55:30 -07:00
Aaron Patterson
a5d894ce56
attributes should be constructed with table objects
2010-09-07 16:47:10 -07:00
Aaron Patterson
0c7a4daaa1
attributes should be associated with tables
2010-09-07 16:38:49 -07:00
Aaron Patterson
c6015cbcd8
serialized attributes should be serialized before validation [ #5525 state:resolved]
2010-09-07 13:39:27 -07:00
Aaron Patterson
c8a2dd3cac
no need to freeze this string
2010-09-07 13:13:13 -07:00
Jakub Suder
2524cf404c
fixed some issues with JSON encoding
...
- as_json in ActiveModel should return a hash
and handle :only/:except/:methods options
- Array and Hash should call as_json on their elements
- json methods should not modify options argument
[#5374 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-09-07 11:33:10 -07:00
Aaron Patterson
2e8a3d0f43
removing useless code, cleaning variable names
2010-09-07 11:28:01 -07:00
Aaron Patterson
604281221c
select should raise error when no block or no parameter is passed
2010-09-07 10:48:14 -07:00
Aaron Patterson
d00f1c18eb
select does not need a *args
2010-09-07 10:33:20 -07:00
Santiago Pastorino
e8c7f1af0f
unscoped has nothing so merging with a relation just returns the relation
2010-09-07 03:33:06 -03:00
Aaron Patterson
b541a963bd
cleaning up confusing logic
2010-09-06 18:56:16 -07:00
Piotr Sarnacki
7c78cc3cca
Use railties:copy_migrations instead of db:copy_migrations
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-06 14:38:45 +02:00
Carlos Antonio da Silva
ed2650646e
Refactor AR validations a bit
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-06 13:40:06 +02:00
Carlos Antonio da Silva
9b610049bb
Cleanup deprecation warnings in active record
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-06 13:39:55 +02:00
Pratik Naik
3bd3e992ff
Improved indentation
2010-09-06 11:54:02 +01:00
Santiago Pastorino
0a7b481903
Use scoped here to get the scoped where
2010-09-05 20:30:43 -03:00
Santiago Pastorino
708ee9c5ac
Make scoped reorder override previous applied orders
...
[5528 state:committed]
2010-09-05 08:28:11 -03:00
Nick Ragaz
16e078d908
failing test for reorder overriding default_scope
...
[5528]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-09-05 08:27:51 -03:00
Neeraj Singh
91fec0d24d
order should always be concatenated.
...
order that is declared first has highest priority in all cases.
Here are some examples.
Car.order('name desc').find(:first, :order => 'id').name
Car.named_scope_with_order.named_scope_with_another_order
Car.order('id DESC').scoping do
Car.find(:first, :order => 'id asc')
end
No special treatment to with_scope or scoping.
Also note that if default_scope declares an order then the order
declared in default_scope has the highest priority unless
with_exclusive_scope is used.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-09-05 08:13:42 -03:00
Piotr Sarnacki
e063879daf
Fix copying migrations to empty directory
2010-09-03 22:59:10 +02:00
Piotr Sarnacki
43a2aef316
rake db:copy_migrations task, which copies railties migrations into application's db/migrate directory
2010-09-03 22:59:09 +02:00
Piotr Sarnacki
75f8ac6ea7
Implemented ActiveRecord::Migrations#copy based on James Adam's idea
...
ActiveRecord::Migration#copy allows to copy migrations from one place
to another, changing migrations versions and adding scope to filename.
For example:
ActiveRecord::Migration.copy("db/migrate",
:blog_engine => "vendor/gems/blog/db/migrate")
will copy all migrations from vendor/gems/blog/db/migrate to db/migrate
with such format:
Versions of copied migrations will be reversioned to be appended after
migrations that already exists in db/migrate
2010-09-03 22:59:09 +02:00
Piotr Sarnacki
b52dfc6726
Added Rails.application.config.paths.db.migrate to remove hardcoded db/migrate paths
2010-09-03 22:59:08 +02:00
Xavier Noria
93acbf6bf3
Merge remote branch 'docrails/master'
2010-09-03 21:30:22 +02:00
Ken Collins
d28438caf2
A few schema changes for the SQL Server adapter.
...
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2010-09-03 14:57:16 +12:00
José Valim
599e46bf24
Revert "Setup explicit requires for files with exceptions. Removed them from autoloading."
...
Booting a new Rails application does not work after this commit [#5359 state:open]
This reverts commit 38a421b34d0b414564e919f67d339fac067a56e6.
2010-09-02 21:11:03 +02:00
Łukasz Strzałkowski
38a421b34d
Setup explicit requires for files with exceptions. Removed them from autoloading.
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-02 11:54:04 +02:00
Greg Hazel
3f49456f5b
remove use of echo [ #4410 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-02 11:50:38 +02:00
Andrew White
4e67bf26aa
Reset default scope in Thread.current when class is unloaded [ #5497 state:resolved]
...
Signed-off-by: Xavier Noria <fxn@hashref.com>
2010-09-01 22:32:41 +02:00
Emilio Tagua
32e296b6ff
Use new finders syntax in docs.
2010-09-01 12:16:08 -03:00
Emilio Tagua
2ce57fd0d9
Fix test: this should return 0 not 7, since Arel was ignoring select clause and now it's fixed.
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-01 15:09:38 +02:00
Jack Dempsey
a79e985923
split out active_record migration logic so others can easily reuse [ #5389 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-01 09:57:57 +02:00
Subba Rao Pasupuleti
dba4efbd0e
nested attributes tests should rely on associated objects to verify results not on assert_difference [ #5206 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-01 09:56:48 +02:00
Pratik Naik
db6190a022
Make all the Relation finder methods consistent
2010-08-31 22:25:28 +01:00
Pratik Naik
dce0cfae8b
Merge remote branch 'miloops/rails_master_fixes'
2010-08-31 22:05:42 +01:00
Pratik Naik
7694b97ddf
Remove default values for Relation#limit/offset/from/create_with
2010-08-31 21:56:21 +01:00
Emilio Tagua
c11eec8482
Avoid calling build_where is no argument is given.
2010-08-31 15:47:59 -03:00
Pratik Naik
c07f0ae52e
Change relation merging to always append select, group and order values
2010-08-31 19:17:18 +01:00
Emilio Tagua
87e50f104a
Improved conditionals usage to prevent calling methods.
2010-08-31 15:06:02 -03:00
Emilio Tagua
2431af1b7f
Don't test conditional in iteration if it is not present just clone it.
2010-08-31 13:19:06 -03:00
Neeraj Singh
d8db5714aa
replacing superclass_delegating_accessor with class_attribute
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-08-31 17:45:06 +02:00
Neeraj Singh
a64cc69d61
Replacing superclass_delegating_accessoror with class_attribute.
...
:store_full_sti_class will have value true or false so there is no
danger of mutability here.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-08-31 17:45:06 +02:00
Neeraj Singh
1620f572bf
Replacing superclass_delegating_accessoror with class_attribute.
...
:partial_attributes will have value true or false so there is no
danger of mutability here.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-08-31 17:45:06 +02:00
Xavier Noria
3805d01c9b
resolves merge conflict
2010-08-31 00:24:05 +02:00
Jeremy Kemper
b861942691
Update CHANGELOGs for 3.0 release and upcoming 3.1
2010-08-29 22:06:48 -07:00
Jeremy Kemper
ef572cad0a
Bump arel to 1.0.1
2010-08-29 16:32:54 -07:00
David Heinemeier Hansson
33afaa446f
Depend on ARel 1.0 w/ tiny fixes
2010-08-29 13:25:45 -05:00
Santiago Pastorino
68a949bae7
PERF: Avoid two method calls
2010-08-28 21:35:20 -03:00
Jeremy Kemper
0d0c46abd1
Clean up CHANGELOGs
2010-08-28 15:45:14 -07:00
Thiago Pradi
ececa75c66
Fixing typo [ #5485 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-08-28 17:51:22 -03:00
Joost Baaij
4b14de72e1
The call-seq directive has no useful effect on our documentation and is not used anywhere else.
...
Worse still, its use breaks some rdoc, replacing method names with a curly brace.
Having just one call-seq directive doesn't add anything since this is covered by regular rdoc.
Having multiple might make sense, but these are already documented with examples.
This partly re-reverts 60de0e56b7f57f0052d7e4f43bd2ef9e363c6a1a but does not
touch the vendorized code in html-scanner.
2010-08-28 00:50:50 +02:00
Sam Aarons
04a8601d5e
Fix em_mysql2 error in rake db:create
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-08-27 14:57:16 -03:00
Jaime Iniesta
e72406e2ba
change 'a SQL' to 'an SQL' as suggested by the api documentation guidelines
2010-08-26 14:23:58 +02:00
Jaime Iniesta
5430f5bd06
lifecycle should be two words, life cycle
2010-08-26 14:23:58 +02:00
Xavier Noria
fa8e17b5c2
Merge remote branch 'docrails/master'
2010-08-26 01:39:16 +02:00
Andrew White
1fbb0684d2
Catch mysql2 access denied errors in rake db:create [ #5432 state:resolved]
...
Signed-off-by: Xavier Noria <fxn@hashref.com>
2010-08-25 18:06:55 +02:00
Aaron Patterson
ffdda4ddfb
use blank? instead of present?, mark SQL literals as SQL literals
...
Conflicts:
activerecord/lib/active_record/relation/query_methods.rb
2010-08-25 05:17:49 -07:00
Aaron Patterson
b28cafe01a
no need to send on a public method
2010-08-25 05:17:49 -07:00
Aaron Patterson
ce7c2f72f4
refactor select { is_a? } to grep()
2010-08-25 05:17:49 -07:00
Aaron Patterson
e1e7122271
mark SQL literals as SQL literals
2010-08-25 05:17:49 -07:00
Neeraj Singh
4e40f00565
minor formatting fixes
2010-08-25 07:39:47 -04:00
Xavier Noria
3ac6646d6f
:nodoc:s #unscoped until its behavior is more clear, now sometimes works, sometimes not
2010-08-25 01:05:51 +02:00
Xavier Noria
a820bd9df6
edit pass to a recent doc patch
2010-08-25 00:22:53 +02:00
Xavier Noria
036f090df1
Merge remote branch 'docrails/master'
2010-08-25 00:17:02 +02:00
Neeraj Singh
747e0744dd
@user.touch should not fail if User does not have updated_at/updated_on column.
...
[#5439 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-08-24 11:24:32 -03:00
Neeraj Singh
f460de1d23
touch operationg if used along with belongs_to will also be invoked on associated objects
2010-08-24 10:21:58 -04:00
Joost Baaij
20333be581
fix broken relative links [ #5415 state:committed]
...
Signed-off-by: Xavier Noria <fxn@hashref.com>
2010-08-24 16:20:32 +02:00
José Valim
6ef60bd9ff
Ensure timestamps are not generated when explicitly set to false [ #5440 state:resolved]
2010-08-24 10:45:16 -03:00
Wincent Colaiuta
7d71b785a9
Add test case for ActiveRecord::Base.record_timestamps = false
...
This is a failing test case for Lighthouse ticket #5440 :
https://rails.lighthouseapp.com/projects/8994/tickets/5440
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-08-24 10:32:45 -03:00
David Heinemeier Hansson
21b1f29720
Master is now targeting 3.1.0.beta
2010-08-23 21:44:57 -05:00
David Heinemeier Hansson
3409f2c691
Depend on latest arel RC
2010-08-23 21:27:41 -05:00
Aaron Patterson
6f4d100761
marking sql literals as sql literals
2010-08-23 18:48:29 -07:00
Aaron Patterson
2e8e6e581f
we should mark sql strings as sql literals
2010-08-23 14:28:15 -07:00
Aaron Patterson
5931a1dbd3
sql literal strings should be marked as sql literal strings
2010-08-23 13:57:22 -07:00
Aaron Patterson
ee9e1570be
we should mark strings as SQL Literal values
2010-08-23 13:30:12 -07:00
Brian Lopez
6d796a71d2
mysql2 adapter is being maintained in the mysql2 gem itself
...
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-08-23 15:59:51 -03:00
Raimonds Simanovskis
2fc29524e1
use database from ARUNIT_DB_NAME environment variable when running tests on Oracle
2010-08-23 10:50:21 -07:00
Neeraj Singh
13ebf69ae4
unscoped does not work when chained with named_scope
2010-08-23 05:45:11 -04:00
Aaron Patterson
cdef4450e5
removing unused code
2010-08-22 17:15:56 -07:00
Raimonds Simanovskis
8f171b4d69
Do not use time zone in test_read_attributes_before_type_cast_on_datetime for Oracle database
...
As currently string_to_time method is not doing time zone conversion to database time zone
2010-08-22 16:35:55 -07:00
Raimonds Simanovskis
f82b1e756a
updated test_should_record_timestamp_for_join_table for Oracle
2010-08-22 16:35:48 -07:00
Xavier Noria
b587bfd589
Merge remote branch 'rails/master'
2010-08-23 01:21:43 +02:00
Evgeniy Dolzhenko
c0549ed2e5
Fix docs to reference ActiveRecord::LogSubscriber
...
since Rails::LogSubscriber doesn't seem to be defined anymore
2010-08-21 09:39:37 +04:00
Brian Lopez
82e389ed30
reload bob after his journy to a new timezone
2010-08-20 20:00:03 -07:00
Jeremy Kemper
c211d904ba
Revert "Just add connection management middleware if running in a concurrent environment."
...
This reverts commit 6b29dc876fe185881d46731c3ae170478a3828fe.
2010-08-20 18:55:02 -07:00
Aaron Patterson
0420fb5647
adding FOUND_ROWS to the connect flags for mysql2
2010-08-20 10:16:22 -07:00
Xavier Noria
0c75ec51a9
Merge remote branch 'rails/master'
2010-08-20 17:18:57 +02:00
Neeraj Singh
87398e531d
Patch for Lighthouse ticket #5419 has been been applied. So reverting this one.
...
Revert "documentation regarding after_validation"
This reverts commit c24aa2f2dca52e1b0ee644e407389f6e89f53007.
2010-08-20 11:08:25 -04:00
Neeraj Singh
c24aa2f2dc
documentation regarding after_validation
2010-08-20 09:48:07 -04:00
Xavier Noria
43291469cb
deletes the rdoc task of each component, they are no longer published separately
2010-08-20 13:30:31 +02:00
Aaron Patterson
949c7e2d0e
fisting after_rollback and after commit callbacks
2010-08-20 00:06:49 -07:00
Santiago Pastorino
b91dcb63d0
Bump up tzinfo to 0.3.23
2010-08-20 02:39:09 -03:00
Aaron Patterson
bfd8be7fab
updates return number of rows matched rather than number of rows affected
2010-08-19 19:13:50 -07:00
Andrew White
0b73f2af0e
Optimize find_sti_class when store_full_sti_class is true
...
[#5403 ]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-08-19 16:03:15 -05:00
Trevor Turk
99c092d4e8
Note about validates_presence_of and nested attributes
2010-08-19 14:49:10 -05:00
Trevor Turk
e6b6d3adad
Note about using attr_accessible with nested attributes
2010-08-19 14:25:15 -05:00
Neeraj Singh
2e45542942
While creating a new record using has_many create method default scope of child should be respected.
...
author.posts.create should take into account default_scope
defined on post.
[#3939 : state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-08-19 14:52:15 -03:00
Aaron Patterson
a4458f5d21
removing useless ternary
2010-08-19 10:46:10 -07:00
Aaron Patterson
a70248c3d8
we should wrap strings as sql literals
2010-08-19 10:35:09 -07:00