Commit Graph

7660 Commits

Author SHA1 Message Date
Jon Leighton
40a711ce29 remove tests for #with_scope (it's now deprecated) 2012-04-25 17:52:28 +01:00
Aaron Patterson
bc7309cde3 Merge pull request #5973 from academia-edu/master
Always quote hstore keys and values
2012-04-25 09:11:23 -07:00
Jon Leighton
2a9763621c Merge remote-tracking branch 'jmbejar/define_array_methods_collection_proxy' 2012-04-25 16:25:42 +01:00
Jon Leighton
8b941e977c Merge remote-tracking branch 'kennyj/fix_5563'
Conflicts:
	activerecord/test/cases/associations/belongs_to_associations_test.rb
2012-04-25 16:07:31 +01:00
Jon Leighton
98de70e2e1 add missing test 2012-04-25 16:04:57 +01:00
Jon Leighton
d242e46781 extract #with_scope and #with_exclusive_scope to active_record_deprecated_finders 2012-04-25 15:45:06 +01:00
Jon Leighton
af27c8b041 extract deprecated code 2012-04-25 15:45:06 +01:00
Jon Leighton
618c5fc3c0 Extract deprecated code 2012-04-25 15:45:06 +01:00
Jon Leighton
ef1d1e1492 fix interpolation for hash merging 2012-04-25 15:45:06 +01:00
Jon Leighton
e8cdb3d5e7 allow merging a single where value 2012-04-25 15:45:05 +01:00
Jon Leighton
f3fce59d13 extract to active_record_deprecated_finders 2012-04-25 15:45:05 +01:00
Jon Leighton
408437334b giving a hash to default scope should not be deprecated (well, not for this reason) 2012-04-25 15:45:05 +01:00
Jeremy Kemper
5cfb0aec1f Merge pull request #5976 from aderyabin/fix1
Duplicate quote_table_name method
2012-04-25 05:13:28 -07:00
Andrey Deryabin
53362fcbcf cleanliness in method parameters 2012-04-25 16:51:40 +07:00
Andrey Deryabin
d6b3dbe34e already defined in quoting 2012-04-25 15:05:45 +07:00
Ryan Fitzgerald
1a05e15e13 Restore .to_s to escape_hstore 2012-04-24 20:59:45 -07:00
Ryan Fitzgerald
0c46dbbc45 Always quote hstore keys and values
escape_hstore uses quotation marks around keys and values only if it
seems necessary. However, it currently breaks in the presence of some
non-ASCII characters. Instead of trying to guess exactly which
characters are safe, it seems better to always use quotes.
2012-04-24 20:46:51 -07:00
kennyj
2aa7c6d065 Fix build. It seems that the Mocha's behavior were changed. 2012-04-25 01:31:26 +09:00
Vijay Dev
5f6ef504b1 Merge pull request #5887 from mcrowe/document-relation-merge
Add documentation to the SpawnMethods#merge method.
2012-04-23 03:37:38 -07:00
Akira Matsuda
851b816f56 be sure to currectly fetch PK name from MySQL even if the PK has some custom option 2012-04-19 22:04:13 +09:00
Jorge Bejar
7dc03cfd76 Define array methods in ActiveRecord::Associations::CollectionProxy
if they are not defined or delegated.
In this way, we have a performance boost invoking some array methods
which are not defined in CollectionAssociation.
2012-04-18 10:57:46 -03:00
Mitch Crowe
43946ee891 Add documentation to the SpawnMethods#merge method. 2012-04-17 18:56:33 -07:00
Vijay Dev
5b336ff443 Merge branch 'master' of github.com:lifo/docrails 2012-04-18 00:10:06 +05:30
Michael de Silva
363888109f Update Rails 3.2.3 release date in changelogs as March 30, 2012
The release date details have been taken from
http://weblog.rubyonrails.org/2012/3/30/ann-rails-3-2-3-has-been-released/
2012-04-16 13:20:53 +03:00
Aaron Patterson
b8f7482695 opening a connection will block if the pool is full 2012-04-15 18:13:15 -07:00
Joshua Wood
ca0af8221a Automatically create indexes for references/belongs_to statements in migrations. 2012-04-14 14:18:42 -07:00
Jon Leighton
d1f4cda84e Merge pull request #5837 from yahonda/new_sequence_name_is_too_long
Fix ORA-00972 error at test_rename_table_with_prefix_and_suffix
2012-04-14 01:21:49 -07:00
Jon Leighton
789bade1b5 extract deprecated code for #find, #first, #last, #all 2012-04-13 19:59:50 +01:00
Jon Leighton
5aea01a610 extract deprecated #calculate code 2012-04-13 19:25:51 +01:00
Jon Leighton
d961f490ff move code out to active_record_deprecated_finders 2012-04-13 19:06:35 +01:00
Jon Leighton
1ad138cf4b fix tests 2012-04-13 18:26:19 +01:00
Jon Leighton
012bab8c9f Merge pull request #5832 from kennyj/fix_5267
Fix a wrong return value from reset_sequence_name method.
2012-04-13 08:54:14 -07:00
Jon Leighton
1391d74e41 move some of the update_all implementation to active_record_deprecated_finders 2012-04-13 16:47:20 +01:00
kennyj
f49d76662e Fix wrong return value from reset_sequence_name method. 2012-04-14 00:33:25 +09:00
Jon Leighton
60ac540053 now we can just manipulate the values hash in #only and #except 2012-04-13 16:17:52 +01:00
Jon Leighton
6311975fb3 use a hash to store relation values 2012-04-13 16:17:52 +01:00
Jon Leighton
7e0b6b2528 doesn't make sense for select! to take a block 2012-04-13 13:17:43 +01:00
Jon Leighton
be89e9a351 remove apply_finder_options call from AssociationScope 2012-04-13 13:17:43 +01:00
Jon Leighton
8d5be98ad7 Make Relation#extending work like other value methods 2012-04-13 13:17:43 +01:00
Jon Leighton
55ee6ed7dd Add Relation#merge! 2012-04-13 13:17:43 +01:00
Jon Leighton
f52253cbeb assert valid keys 2012-04-13 13:17:42 +01:00
Jon Leighton
0183193a6a Allow Relation#merge to take a hash 2012-04-13 13:17:42 +01:00
Jon Leighton
e4f0fbd994 we have no need for the ASSOCIATION_METHODS constant 2012-04-13 13:17:42 +01:00
Jon Leighton
a258c27653 we don't need to test that constant assignment works 2012-04-13 13:17:42 +01:00
Jon Leighton
88d1fafc22 refactoring 2012-04-13 13:17:42 +01:00
Jon Leighton
3b86336694 Extract clusterfuck method for surgery 2012-04-13 13:17:42 +01:00
Yasuo Honda
7d65585785 Fix ORA-00972 error at test_rename_table_with_prefix_and_suffix 2012-04-13 07:19:38 -04:00
Reg Braithwaite
dcb2279674 mention that coercion only happens when the primary key is an integer and use +to_i+ formatting 2012-04-12 22:55:11 -04:00
Reg Braithwaite
859a91b59a Documents that ActiveRecord's find by id uses to_i to coerce its arguments to integers 2012-04-12 22:24:21 -04:00
Rodrigo Flores
944ed4b960 Revert "Added documentation to explain what happens if you don't set any values for the dependent option on has_many"
This reverts commit 820a677d8622a540188704941a31871ed4d61461.
2012-04-12 22:12:08 -03:00
Rodrigo Flores
820a677d86 Added documentation to explain what happens if you don't set any values for the dependent option on has_many 2012-04-12 21:51:35 -03:00
kennyj
365b8b6db7 Fix #5563. Should reflect the most recent change to either of association / id. 2012-04-13 02:25:19 +09:00
kennyj
0f3901e910 @stale_state should be nil when a model isn't saved. 2012-04-13 02:25:13 +09:00
Jon Leighton
8c2c60511b Add bang versions of relation query methods.
The main reason for this is that I want to separate the code that does
the mutating from the code that does the cloning.
2012-04-12 17:57:54 +01:00
kennyj
611020b4dd Fix typo on the add_index. 2012-04-13 01:25:58 +09:00
kennyj
1e417d5cd2 Some refactor for association.
* Remove unused association_class method.
* Remove a unnecessary assignment.
* Move @updated to BelongsToAssociation that only reference this instance variable.
* Reset @stale_state at the reset method. I think this place is right place.
2012-04-12 23:28:31 +09:00
Jon Leighton
eda65f391e move apply_finder_options to active_record_deprecated_finders 2012-04-12 15:02:00 +01:00
Jon Leighton
dd2c9b9578 add active_record_deprecated_finders as a dep 2012-04-12 15:01:43 +01:00
Jon Leighton
19ecde00ff Merge pull request #5720 from kennyj/should_use_klass_method
Get a properly aliased_table_name, when we use a polymorphic association.
2012-04-11 16:18:36 -07:00
Juanjo Bazán
1a20683f09 Override AR::Relation methods in NullRelation.
So a NullRelation (Relation#none) is chainable with database methods.
2012-04-11 15:24:23 +02:00
dcurtis
248fa70ccd Corrected grammatical errors in schema_dumper and scoping/default 2012-04-10 22:05:43 -07:00
Rafael Mendonça França
6f6c2909dc Fix delete_all when chained with joins.
Closes #5202 and #919
2012-04-10 23:45:01 -03:00
Jeremy Kemper
9f37f335f2 Merge pull request #5718 from benedikt/master
Removes caching from ActiveRecord::Core::ClassMethods#relation
2012-04-08 11:30:18 -07:00
Doug Cole
cd6ddc865a refactor configuration of insert_returning 2012-04-07 18:39:04 -07:00
Vijay Dev
cf9664adcf fix markup error [ci skip] 2012-04-08 02:13:51 +05:30
Santiago Pastorino
a9398a7da4 Merge pull request #5716 from jurriaan/tr-gsub-cleanup
Updated/changed unneeded tr/gsubs
2012-04-04 10:43:24 -07:00
Vijay Dev
02b9c22df8 Merge branch 'master' of github.com:lifo/docrails
Conflicts:
	guides/source/engines.textile
2012-04-04 12:42:22 +05:30
Tim Pope
a49944844f DATABASE_URL allows omission of database.yml 2012-04-03 15:57:01 -07:00
Aaron Patterson
3b378a7840 use File.binread to pull in the schema cache 2012-04-03 15:57:01 -07:00
Benedikt Deicke
402576b044 Adds test to check that circular preloading does not modify Model.unscoped (as described in #5667) 2012-04-03 21:13:24 +02:00
kennyj
bfb9b7165e Get a properly aliased_table_name, when we use a polymorphic association. 2012-04-04 01:21:35 +09:00
Benedikt Deicke
68677ffb82 Removes caching from ActiveRecord::Core::ClassMethods#relation
The #relation method gets called in four places and the return value was instantly cloned in three of them. The only place that did not clone was ActiveRecord::Scoping::Default::ClassMethods#unscoped. This introduced a bug described in #5667 and should really clone the relation, too. This means all four places would clone the relation, so it doesn't make a lot of sense caching it in the first place.

The four places with calls to relations are:

activerecord/lib/active_record/scoping/default.rb:110:in `block in build_default_scope'"
activerecord/lib/active_record/scoping/default.rb:42:in `unscoped'"
activerecord/lib/active_record/scoping/named.rb:38:in `scoped'"
activerecord/lib/active_record/scoping/named.rb:52:in `scope_attributes'"
2012-04-03 17:00:37 +02:00
Jurriaan Pruis
2d8396fc9f Updated/changed useless tr/gsubs 2012-04-03 15:16:09 +02:00
Waseem Ahmad
a17874ee56 Remove unnecessary articles. 2012-04-03 05:41:07 +05:30
Doug Cole
3a0d08163a pick better names and add a little documentation 2012-04-01 15:23:06 -07:00
Doug Cole
945c53e7b5 improve test coverage 2012-03-31 18:41:24 -07:00
Doug Cole
20615e74cb refactor 2012-03-31 18:13:55 -07:00
Doug Cole
3475051f7f update mysql for new exec_insert signature 2012-03-31 18:13:40 -07:00
Doug Cole
f09bb33bb5 add use_returning as a postgresql connection config 2012-03-31 17:14:28 -07:00
Jon Leighton
86aefdb4f2 Fix #5667. Preloading should ignore scoping. 2012-03-30 16:19:32 +01:00
Jon Leighton
1ce75450a9 clear up duplication between Persistence#destroy and Locking#destroy 2012-03-30 14:39:55 +01:00
Jon Leighton
43f9622c67 fix test 2012-03-30 14:37:37 +01:00
Jon Leighton
bd40e5c9e4 whitespace ✂️ 2012-03-30 14:36:33 +01:00
Jon Leighton
2eb111815d Merge pull request #5334 from courtland/master
Fix deleting from a HABTM join table upon destroying an object of a model with optimistic locking enabled.
2012-03-30 06:08:05 -07:00
Jon Leighton
13b3c77e39 Add Relation#find_by and Relation#find_by! 2012-03-30 12:52:29 +01:00
Jon Leighton
3a8c54396e Merge pull request #2945 from Casecommons/nested_attributes_module
Nested attribute setters can be overridden.
2012-03-30 03:25:30 -07:00
Jon Leighton
7dd7d76b86 recurse in read_attribute we get caching / don't duplicate code 2012-03-30 11:09:27 +01:00
Carlos Antonio da Silva
f50c160cd0 Deprecate Column#type_cast_code 2012-03-29 23:04:51 -03:00
Carlos Antonio da Silva
77a0fc1c7a Properly typecast id attribute when using custom primary key 2012-03-29 22:59:30 -03:00
Guillermo Iguaran
bb2e2d8cb6 CHANGELOG entry for AR#slice 2012-03-29 17:50:06 -05:00
Guillermo Iguaran
01ede9a211 Add ActiveRecord::Base#slice to slice method calls 2012-03-29 17:48:35 -05:00
Alexander Zubkov
0f2555f0af Change the example for habtm association to use proc according to changelog 2012-03-29 12:20:55 +04:00
Jonathan Mukai & Peter Jaros
135d704a55 Nested attribute setters can be overridden.
Overriding implementation can call super.
2012-03-28 19:08:31 -04:00
Xavier Noria
bbd2caeaf9 Merge pull request #4843 from seamusabshere/patch-1
Possibly clearer way of getting rid of ` and "
2012-03-28 16:01:05 -07:00
Jon Leighton
6cff09038d much code can be deleted thanks to @tenderlove's refactoring 2012-03-28 16:38:38 +01:00
Santiago Pastorino
a3e5b7bdf2 Merge pull request #5616 from cbartlett/migration-indent
Fix indenting in migration generator
2012-03-27 20:09:37 -07:00
Juanjo Bazán
2fa7ccf7ae Remove Arel::Relation constant from PredicateBuilder. 2012-03-27 14:13:28 -07:00
Aaron Patterson
e96d04a2e4 attributes are cached by string keys, so to_s to support symbols. fixes #5549 2012-03-27 11:27:51 -07:00
Vijay Dev
b42fbd3ecb Merge branch 'master' of github.com:lifo/docrails 2012-03-27 21:26:37 +05:30
Colin Bartlett
e5156c9564 Fix indenting in migration generator
$ rails generate migration remove_foo_from_bars foo:string

This currently generates:

      def up
        remove_column :bars, :foo
          end

Fix it:

      def up
        remove_column :bars, :foo
      end
2012-03-27 11:41:31 -04:00
Arun Agrawal
4cd0b4e7c3 removed unused variables 2012-03-27 15:06:14 +05:30
Xavier Noria
ded74dfd8b Merge pull request #5582 from chendo/master
Remove "needless boolean casting"
2012-03-26 18:14:48 -07:00
Aaron Patterson
41dfc46717 Merge pull request #2621 from icco/master
Issue with schema dump
2012-03-26 17:24:48 -07:00
Juanjo Bazán
fc25feb341 Missing generated query for pluck method.
(and changed the use of true for a more database agnostic example).
2012-03-27 00:08:31 +03:00
Guten
9637de6b47 ActiveRecord::Coders::YAMLColumn#dump should raise an error
closes #2737

Conflicts:

	activerecord/lib/active_record/coders/yaml_column.rb
2012-03-26 21:57:39 +02:00
Jack Chen (chendo)
ef64c6ba8c Remove 'needless boolean casting'.
"Predicates in Rails rely on standard Ruby semantics for boolean values
and guarantee no singletons whatsoever." - @fxn
2012-03-26 15:55:16 +11:00
Waseem Ahmad
9ff2e928ef Use one 'be'. 2012-03-24 20:26:44 +05:30
Vijay Dev
014498e1d7 Merge branch 'master' of github.com:lifo/docrails
Conflicts:
	guides/source/ruby_on_rails_guides_guidelines.textile
2012-03-24 17:15:10 +05:30
Aaron Patterson
b4115fdbc0 properly namespace the fixture exception 2012-03-22 16:25:48 -07:00
Joe Goggins
65a3020851 Adding documentation for ActiveRecord::Base.abstract_class to clarify a particular usecase for this feature (to allow you to use inheritance in ActiveRecord without using the STI table name 2012-03-22 10:02:08 -05:00
Marcelo Silveira
86d1dfb821 Avoid another blank line in generated migration and remove assertion as per @spastorino request 2012-03-21 19:28:34 -03:00
Jon Leighton
0a12a5f816 Deprecate eager-evaluated scopes.
Don't use this:

    scope :red, where(color: 'red')
    default_scope where(color: 'red')

Use this:

    scope :red, -> { where(color: 'red') }
    default_scope { where(color: 'red') }

The former has numerous issues. It is a common newbie gotcha to do
the following:

    scope :recent, where(published_at: Time.now - 2.weeks)

Or a more subtle variant:

    scope :recent, -> { where(published_at: Time.now - 2.weeks) }
    scope :recent_red, recent.where(color: 'red')

Eager scopes are also very complex to implement within Active
Record, and there are still bugs. For example, the following does
not do what you expect:

    scope :remove_conditions, except(:where)
    where(...).remove_conditions # => still has conditions
2012-03-21 22:18:18 +00:00
Jon Leighton
fd68bd23b6 Avoid obscure &Proc.new thing 2012-03-21 20:37:22 +00:00
Jon Leighton
f6db31ec16 Remove valid_scope_name? check - use ruby
scope is syntactic sugar for defining a class method. Ruby allows
redefining methods but emits a warning when run with -w. So let's
not implement our own logic for this. Users should run with -w if they
want to be warned about redefined methods.
2012-03-21 20:30:48 +00:00
Jon Leighton
884e5b7558 no need for cast 2012-03-21 20:25:51 +00:00
Jon Leighton
7c1275a005 no need for lvar 2012-03-21 20:23:46 +00:00
José Valim
14b2cf6a0a Merge pull request #5532 from mhfs/migration_blank_line
Remove blank line from generated migration
2012-03-21 00:34:38 -07:00
Travis Jeffery
b2a59388b2 Generate Migration Thats Adds Removed Index
When generating a migration that removes a field with an index, the down
will add both the field and its index.
2012-03-21 01:20:35 +00:00
Marcelo Silveira
c63306b1a8 Remove blank line from generated migration 2012-03-20 21:44:45 -03:00
Dave Burt
a4b1423f4e Correct description of ['migrated_at > ?', 1.week.ago] from "more than a week ago" to "more recently than a week ago." 2012-03-20 16:13:19 +11:00
Sandeep
70a19b7d42 changed all.map to pluck 2012-03-19 15:17:49 +05:30
José Valim
d802a6c275 Merge pull request #3329 from armstrjare/autosave_collection_new_record_bug
Autosave association doesn't save all records on a new record for a collection association if there are records marked for destruction
2012-03-18 04:13:28 -07:00
Jared Armstrong
f1903d8db7 Fix bug with autosave collection association on new record with a marked for destroy record in autosave collection. 2012-03-18 20:20:01 +13:00
Aaron Patterson
2b5cb1cd41 Merge pull request #5486 from kennyj/fix_5435
Fix GH #5435. db:structure:dump should be re-enable.
2012-03-17 21:50:37 -07:00
Ruben Davila
9679d4015e Fix typo in ActiveRecord::Relation#blank? test 2012-03-17 12:22:54 -05:00
Jonathan R. Wallace
9e09e8f526 Updates 'modyfing' typo to 'modifying' 2012-03-17 11:23:39 -04:00
José Valim
4711298767 Merge pull request #5321 from pfeiffer/uniqueness_validator_conditions
Add :conditions option to uniqueness validator
2012-03-17 07:13:58 -07:00
kennyj
0360b3eb1f Fix GH #5435. db:structure:dump should be reenable. 2012-03-17 13:57:10 +09:00
Rafael Mendonça França
404d785d29 Fix ActiveRecord::Relation#blank? tests 2012-03-16 17:05:35 -03:00
José Valim
8d87d5c947 Merge pull request #5469 from yakko/master
tests for Relation .present? .blank?
2012-03-16 07:37:13 -07:00
Thiago Almeida
964ed6e802 test relation presence fix 2012-03-16 11:30:24 -03:00
Thiago Almeida
4498f93e68 tests for Relation .present? and .blank? are check cases and shouldn't force sql-count 2012-03-16 11:04:24 -03:00
José Valim
6d0047aff8 Merge pull request #5467 from bogdan/initialize_callbacks
ActiveRecord::Core#initialize: improve performance
2012-03-16 05:34:16 -07:00
José Valim
fa7a3aaac7 Merge pull request #5461 from yakko/master
relation .present? and .blank? should not query SELECT COUNT(DISTINCT id)
2012-03-16 00:22:19 -07:00
Thiago Almeida
9d52b45a5b relation .present? and .blank? should not query SELECT COUNT(DISTINCT id) 2012-03-16 01:14:24 -03:00
Aaron Patterson
e61e0c0b03 Merge pull request #5327 from kennyj/fix_explicitly_inheraitance_column
Don't reset inheritance_column when setting explicitly.
2012-03-15 18:31:20 -07:00
Aaron Patterson
e6c95fe391 errors should probably be logged as errors 2012-03-15 12:12:42 -07:00
Yasuo Honda
0ecba955e0 Address the dump file format for hstore 2012-03-15 14:12:47 -04:00
Bogdan Gusiev
791251bf8b ActiveRecord::Core#initialize: improve performance 2012-03-15 10:24:13 +02:00
kennyj
2d787f89f8 Fix GH #5430. A Payload name for schema_search_path should be SCHEMA. 2012-03-15 02:07:01 +09:00
Carlos Antonio da Silva
dde3058c3a Expand changelog and upgrading rails guide with IdentityMap info 2012-03-13 20:08:55 -03:00
Carlos Antonio da Silva
a8dd21d8b4 Remove IdentityMap 2012-03-13 20:08:54 -03:00
Vijay Dev
800c70a8f9 Merge branch 'master' of github.com:lifo/docrails 2012-03-13 23:29:30 +05:30
kennyj
fdb8805cdd Fix GH #5399. connection_pools's keys are ActiveRecord::Base::ConnectionSpecification objects. 2012-03-14 02:11:40 +09:00
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
Michael de Silva
ce8df43a36 added clarification stating the counter_cache attribute needs to be created on the associate class via a migration 2012-03-11 06:30:06 +03:00
Ryan Oblak
12c44fe7f5 Fixed bug in Quoting that caused classes to be quoted incorrectly 2012-03-09 16:33:40 -08:00
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
Rafael Mendonça França
d804790634 Fix my name in the CHANGELOG to follow the convention
Also add missing entries and use the formating convention
2012-03-09 00:54:21 -03:00
Aaron Patterson
657095d8bb ensure that released connections move between threads 2012-03-08 16:12:49 -08: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
8a714c4d80 fix incorrect changelog headings [ci skip].
Last commit message should not have said 'Rails 4' either
2012-03-09 02:30:49 +05:30
Vijay Dev
db6542178c changelog updates for Rails 4 [ci skip] 2012-03-09 02:22:17 +05:30
Vijay Dev
188d1d2787 Merge branch 'master' of github.com:lifo/docrails 2012-03-09 00:07:59 +05:30
José Valim
58a55595ca Merge pull request #5306 from kennyj/fix_69c7f02
Change the message string to use in  test case.
2012-03-08 04:00:02 -08:00
kennyj
aa9b64790b Update CHANGELOG to fix wrong extension. 2012-03-08 20:07:44 +09:00
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
Nick Rogers
2931f413a5 Tests for removing a HABTM association when optimistic locking is enabled. 2012-03-07 23:56:23 -05: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
Nick Rogers
03888825e2 Fix deleting from a HABTM join table upon destroying an object of a model with optimistic locking enabled. Issue #5332. 2012-03-07 17:16:21 -05:00
kuahyeow
a149612c0b Add tests to test that through associations are not readonly, and we can update the records we retrive from the association 2012-03-08 09:48:59 +13: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
Mattias Pfeiffer
4b6daef3fc Correct grammar in documentation 2012-03-07 16:36:03 +01: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
kennyj
cdfcbc48b2 Don't reset inheritance_column when setting explicitly. 2012-03-08 00:00:58 +09:00
Mattias Pfeiffer
3d8592657f Change syntax to accept an AR::Relation instead of old conditions hash/array. 2012-03-07 15:59:28 +01:00
kennyj
37802dd51e Change the string to use in test case. 2012-03-07 23:33:52 +09:00
Mattias Pfeiffer
6185c4947e Add :conditions option to uniqueness validator 2012-03-07 13:49:45 +01: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
Rafael Mendonça França
e9bf0e3157 Add test case to has_many through association when mass_assignment_sanitizer is
:strict
2012-03-05 16:58:19 -03: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
922c9e2d27 Tweak activerecord/test/cases/validations/i18n_generate_message_validation_test.rb 2012-03-05 18:29:03 +01:00
Christopher Dell
0eada113c3 Test that RecordInvalid exception's translation falls back to the :errors namespace 2012-03-05 18:06:37 +01: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
Carlos Antonio da Silva
357f1c6850 Fix message assertions for quoting database name in "show tables" for mysql 2012-03-04 16:35:36 -03: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
9a2e164d73 Added test case for new_record round trip with associations problem 2012-03-04 11:42:20 -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