Commit Graph

5859 Commits

Author SHA1 Message Date
Aaron Patterson
0bb6fcb1d1 Merge pull request #5294 from robinroestenburg/master
Refactoring of `arel_attributes_values` method
2012-03-12 12:02:52 -07:00
Aaron Patterson
0210c44cd3 make sure connections returned after close are marked as in_use 2012-03-12 11:51:28 -07:00
Jonathan Rochkind
27ebb3dc8c deprecated clear_stale_active_connections! can call #reap instead of no-op'ing, #reap does the same thing 2012-03-12 11:14:22 -04:00
Andrew White
ca99beb4a9 Add documentation for find_or_create_by_{attribute}! method. 2012-03-12 15:02:18 +00:00
Andrew White
eee32af45e Add dynamic find_or_create_by_{attribute}! method. 2012-03-12 14:16:19 +00:00
Denis Jean
a2c2f40661 fix activerecord query_method regression with offset into Fixnum
add test to show offset query_methods on mysql & mysql2

change test to cover public API
2012-03-12 17:44:10 +05:30
Alexey Vakhov
48a7df9a9f In AR depths use &:to_i before :uniq to process mixed arrays likes ["1", 1] correct 2012-03-09 15:21:12 +04:00
Aaron Patterson
d523504c2f make active_connection? return true only if there is an open connection in use for the current thread. fixes #5330 2012-03-08 15:40:23 -08:00
Vijay Dev
188d1d2787 Merge branch 'master' of github.com:lifo/docrails 2012-03-09 00:07:59 +05:30
Jon Leighton
104eebb4cc Merge pull request #5289 from rafaelfranca/fix-through-associations
Fix has_many through associations when mass_assignment_sanitizer is strict
2012-03-08 00:13:08 -08:00
Aaron Patterson
447ecb08ca Merge pull request #5162 from kennyj/schema_cache_dump
[Proposal] Schema cache dump
2012-03-07 16:44:50 -08:00
Rafael Mendonça França
c9c7ee7710 Not need to pass join attributes to association build 2012-03-07 21:07:29 -03:00
Aaron Patterson
89cef0757a Merge pull request #5315 from travisjeffery/enhance_postgresql_adapter_schema_support
Enhance PostgreSQL Adapter schema support
2012-03-07 10:58:55 -08:00
Travis Jeffery
8dc1a625c8 Adds #create/drop_schema on the PostgreSQL Adapter. 2012-03-07 17:55:33 +00:00
José Valim
3da31b948f Merge pull request #5316 from Jacobkg/master
Update ActiveRecord::AttributeMethods#attribute_present? to return false for empty strings
2012-03-07 07:03:59 -08:00
Vijay Dev
5e4102ef5f Merge pull request #5305 from arunagw/warning_fix
warning fix : mismatched indentations at 'end' with 'case'
2012-03-07 04:02:08 -08:00
Jacob Green
04aca254cc attribute_present? should return false for empty strings 2012-03-06 22:32:29 -08:00
Travis Jeffery
577971f05a Add #schema_names to PostgreSQL Adapter. 2012-03-07 05:27:12 +00:00
Robin Roestenburg
a02d237518 Removed flag attributes. 2012-03-06 23:54:38 +01:00
Vijay Dev
7c90d91c3c Clean up module docs [ci skip]
Removed some useless docstrings and no-doc'ed some.
2012-03-07 01:04:14 +05:30
Arun Agrawal
3c81045c07 warning fix : mismatched indentations at 'end' with 'case' 2012-03-06 23:18:07 +05:30
kennyj
f2b048529b Revert table_name= needs connection now, so just stub table_name 2012-03-07 02:37:40 +09:00
Robin Roestenburg
6024d53534 Refactored method arel_attributes_values. 2012-03-06 00:14:41 +01:00
Jean Boussier
c97a166691 Fix #5069 - Protect foreign key from mass assignment throught association builder 2012-03-05 10:08:09 -08:00
José Valim
c5a47b3207 Merge pull request #5274 from tigrish/master
Update I18n defaults for activerecord.errors.messages.record_invalid
2012-03-05 09:45:09 -08:00
Braden Schaeffer
a75afbdd82 Fix doc examples for has_and_belongs_to_many association 2012-03-05 11:35:20 -06:00
Christopher Dell
4da6e1cce2 Allow translations of activerecord.errors.messages.record_invalid to be looked up in errors.messages.record_invalid 2012-03-05 00:17:47 +01:00
Michael Koziarski
641a4f6240 Whitelist all attribute assignment by default.
Change the default for newly generated applications to whitelist all attribute assignment.  Also update the generated model classes so users are reminded of the importance of attr_accessible.
2012-03-05 11:25:25 +13:00
Jon Leighton
f8f66a3792 Merge pull request #5268 from carlosantoniodasilva/ar-new-record-warning
Fix ActiveRecord warning in tests with Marshal
2012-03-04 10:34:34 -08:00
Jon Leighton
851fd8f572 tidy up formatting 2012-03-04 18:11:15 +00:00
Jon Leighton
2fdb5219fb Merge pull request #5267 from kennyj/fix_4674
Fix GH #4674. Reset column information and sequence name when setting table_name.
2012-03-04 10:03:34 -08:00
kennyj
69c7f02488 Fix GH #3163. Should quote database on mysql/mysql2. 2012-03-05 00:07:20 +09:00
Carlos Antonio da Silva
9b9357b26e Initialize @stale_state to nil in association
This apparently fix the warning related to @new_record variable not
being initialized in AR's test suit, when an association is built and
the object is marshalled/loaded.

See these tests in AR's base_test.rb:

test_marshalling_with_associations
test_marshalling_new_record_round_trip_with_associations

Closes #3720.
2012-03-04 11:46:30 -03:00
kennyj
200d994870 Don't clear sequence name when we explicitly assign it. 2012-03-04 22:24:02 +09:00
kennyj
640f6c201d Fix GH #4674. Reset column information and sequence name when setting table_name. 2012-03-04 22:22:27 +09:00
Jon Leighton
7ba0fe2172 Remove unusused variables 2012-03-04 11:23:39 +00:00
Piotr Sarnacki
4443b3647d Merge pull request #5255 from carlosantoniodasilva/active-record-review
Refactor and cleanup in some ActiveRecord modules
2012-03-03 11:10:17 -08:00
Vijay Dev
2aec357b7e Merge pull request #4984 from raghunadhd/change_orderhash
Refactored code
2012-03-03 09:05:23 -08:00
Vijay Dev
f9e26940b3 Merge branch 'master' of github.com:lifo/docrails 2012-03-03 22:08:24 +05:30
Carlos Antonio da Silva
50725cec39 Refactor and cleanup in some ActiveRecord modules
* Avoid double hash lookups in AR::Reflection when reflecting associations/aggregations
* Minor cleanups: use elsif, do..end, if..else instead of unless..else
* Simplify DynamicMatchers#respond_to?
* Use "where" instead of scoped with conditions hash
* Extract `scoped_by` method pattern regexp to constant
* Extract noisy class_eval from method_missing in dynamic matchers
* Extract readonly check, avoid calling column#to_s twice in persistence
* Refactor predicate builder, remove some variables
2012-03-03 04:09:50 -03:00
Aaron Patterson
b5c939dcb3 only log an error if there is a logger. fixes #5226 2012-03-02 10:25:09 -08:00
Xavier Noria
fcef72890b revert setting NOT NULL constraints in add_timestamps
Commit 3dbedd2 added NOT NULL constraints both to table
creation and modification. For creation the new default
makes sense, but the generic situation for changing a
table is that there exist records. Those records have
no creation or modification timestamps, and in the
general case you don't even know them, so when updating
a table these constraints are not going to work. See
a bug report for this use case in #3334.
2012-03-01 16:15:00 -08:00
Waseem Ahmad
92887ca315 Add documentation for IndexDefinition. 2012-03-02 01:28:30 +05:30
kennyj
5cbba30a12 Support judgement expired schema cache dump. 2012-03-01 01:19:27 +09:00
kennyj
0da12df260 Load db/schema_cache.dump duaring boot time. 2012-03-01 01:13:14 +09:00
kennyj
0150a212c0 Add db:schema:cache:dump and db:schema:cache:clear tasks. 2012-03-01 01:01:12 +09:00
kennyj
5ca4fc9581 Add support schema cache dump and load. 2012-03-01 00:52:04 +09:00
Xavier Noria
7d29d7afd5 Merge pull request #5212 from MarkMT/master
update_only documentation for accepts_nested_attributes_for
2012-02-28 14:33:19 -08:00
Mark
27da612eec Modified comments explaining what the update_only option does. 2012-02-28 14:28:44 -06:00
José Valim
5bbd2d3aa8 Merge pull request #5196 from lest/patch-3
force datetime attributes to be changed, fix GH #3965
2012-02-28 10:09:40 -08:00