aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
Commit message (Collapse)AuthorAgeFilesLines
* made dynamic finders alias_attribute awareMaximilian Schneider2012-06-223-1/+12
| | | | | previously dynamic finders only worked in combination with the actual column name and not its alias defined with #alias_attribute
* Merge pull request #6798 from kennyj/db-rake-structure-loadCarlos Antonio da Silva2012-06-204-34/+107
|\ | | | | Refactor db:structure:load task.
| * Remove duplicated codes.kennyj2012-06-211-41/+11
| |
| * Refactor db:structure:load task.kennyj2012-06-214-0/+103
| |
* | Merge pull request #4396 from kennyj/fix_4259Rafael Mendonça França2012-06-201-0/+32
|\ \ | |/ |/| | | Fix GH #4259. When we execute schema dumper, we must remove table_name_prefix and table_name_suffix.
| * Fix GH #4259. We must remove table_name_prefix and table_name_suffix, when ↵kennyj2012-01-101-0/+32
| | | | | | | | we execute schema dumper.
* | Extract conditional to a method to avoid duplicationRafael Mendonça França2012-06-191-0/+3
| | | | | | | | Also use if/else block to not use short circuit return
* | handle joins/includes correctly for pluck and calculation.Andrey Deryabin2012-06-191-0/+43
| | | | | | | | Fix #5990
* | Merge pull request #6782 from kennyj/db-rake-structure-dumpRafael Mendonça França2012-06-194-1/+106
|\ \ | | | | | | Refactor db:structure:dump task.
| * | Refactor db:structure:dump task.kennyj2012-06-204-1/+106
| | |
* | | Merge pull request #6785 from kennyj/rename_testcase_nameCarlos Antonio da Silva2012-06-191-1/+1
|\ \ \ | | | | | | | | Rename testcase name. It's wrong in the context.
| * | | Rename testcase name. It's wrong in the context.kennyj2012-06-201-1/+1
| |/ /
* / / Rename MySQLTestPurge to MySQLPurgeTest for consistency.kennyj2012-06-201-1/+1
|/ /
* | Refactor db:charset taskSimon Jefford2012-06-194-3/+93
| | | | | | | | | | In a similar vein to Pat's work on create, drop etc, the db:charset task is now a one liner in databases.rake
* | Validates_numericality_of is skipped when changing 0 to to non-empty stringAngelo capilleri2012-06-191-0/+10
| | | | | | | | | | | | | | | | | | | | This happens when A has_many many B and A accepts_nested_attributes B that has a numeric colum with initial 0 value. So a.update_attributes({:b_attributes => { :id => b.id, :numeric => 'foo' }}) passes the validation test but, the value of :numeric doesn't change. his commit forces that the update fails with the above conditions. Fixes #6393 Fixes #2331
* | Remember the stored attributes in a config attribute.Joost Baaij2012-06-181-1/+5
| | | | | | | | | | | | This allows you to retrieve the list of attributes you've defined. Usable for e.g. selects in the view, or interators based on the attributes you wish to store in the serialized column.
* | Merge pull request #6743 from steveklabnik/remove_composed_ofRafael Mendonça França2012-06-185-401/+0
|\ \ | | | | | | | | | Removing composed_of
| * | Removing composed_of from ActiveRecord.Steve Klabnik2012-06-185-401/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This feature adds a lot of complication to ActiveRecord for dubious value. Let's talk about what it does currently: class Customer < ActiveRecord::Base composed_of :balance, :class_name => "Money", :mapping => %w(balance amount) end Instead, you can do something like this: def balance @balance ||= Money.new(value, currency) end def balance=(balance) self[:value] = balance.value self[:currency] = balance.currency @balance = balance end Since that's fairly easy code to write, and doesn't need anything extra from the framework, if you use composed_of today, you'll have to add accessors/mutators like that. Closes #1436 Closes #2084 Closes #3807
* | | Add ensure Joke.reset_sequence_nameYasuo Honda2012-06-191-0/+2
|/ / | | | | | | | | to avoid ORA-02289: sequence does not exist for `SELECT "BLACK_JOKES_SEQ".NEXTVAL FROM dual`
* | Change minimum (default) log level in PostgreSQL to warning.kennyj2012-06-181-0/+4
| |
* | fix invalid syntax and sqlite rake failing testsFrancesco Rodriguez2012-06-183-4/+6
| |
* | Merge pull request #6761 from freelancing-god/db-rakeJon Leighton2012-06-174-0/+715
|\ \ | | | | | | Get logic out of db rake tasks, and into classes and objects
| * | Rails is the default (but now override able) source for environment and path.Pat Allan2012-06-172-28/+32
| | |
| * | Cleaning up after some warnings, adding slightly higher-level tests.Pat Allan2012-06-172-2/+296
| | |
| * | db:drop and some of db:test:purge.Pat Allan2012-06-173-2/+180
| | |
| * | db:create for PostgreSQL pulled out into a class.Pat Allan2012-06-171-0/+57
| | |
| * | db:create for MySQL now much cleaner.Pat Allan2012-06-171-0/+120
| | |
| * | Confirm connection is not established if file exists.Pat Allan2012-06-171-1/+10
| | |
| * | A beginning of sorts.Pat Allan2012-06-171-0/+53
| | | | | | | | | | | | Minimal implementation that supports db:create SQLite replacement
* | | Fix deprecation warnings when using ↵Jon Leighton2012-06-151-0/+32
| | | | | | | | | | | | config.active_record.mass_assignment_sanitizer=
* | | Fix config.active_record.whitelist_attributes with AR::ModelJon Leighton2012-06-151-0/+27
| | |
* | | Simplify AR configuration code.Jon Leighton2012-06-152-3/+3
| | | | | | | | | | | | | | | Get rid of ActiveModel::Configuration, make better use of ActiveSupport::Concern + class_attribute, etc.
* | | Remove unneded tests.Rafael Mendonça França2012-06-141-11/+1
| | | | | | | | | | | | | | | | | | | | | Before 7f4b0a1231bf3c65db2ad4066da78c3da5ffb01, this test are asserting that update_attribute does the dirty tracking. Since we remove this method and update_column write in the database directly this tests will always fail>
* | | Merge pull request #6713 from etehtsea/activerecord-uuidRafael Mendonça França2012-06-143-6/+22
|\ \ \ | | | | | | | | | | | | Add uuid datatype support to PostgreSQL adapter
| * | | Add uuid type support to PostgreSQL adapterKonstantin Shabanov2012-06-143-6/+22
| | | |
* | | | Remove update_attribute.Steve Klabnik2012-06-144-66/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Historically, update_attribute and update_attributes are similar, but with one big difference: update_attribute does not run validations. These two methods are really easy to confuse given their similar names. Therefore, update_attribute is being removed in favor of update_column. See the thread on rails-core here: https://groups.google.com/forum/?fromgroups#!topic/rubyonrails-core/BWPUTK7WvYA
* | | | Need a assert here in testsArun Agrawal2012-06-121-2/+2
| | | |
* | | | Merge pull request #6676 from aurelian/masterRafael Mendonça França2012-06-121-0/+4
|\ \ \ \ | |/ / / |/| | | Don't assign the attributes if the list is empty
| * | | Don't assign the attributes if the list is empty.Aurelian Oancea2012-06-081-0/+4
| | | |
* | | | Remove warnings and unused codeRafael Mendonça França2012-06-112-7/+2
| | | |
* | | | No need to cache table metadata in advance now that #6683 was merged.Rafael Mendonça França2012-06-112-16/+0
| | | |
* | | | Merge pull request #6492 from pmahoney/fair-connection-pool2Rafael Mendonça França2012-06-114-1/+112
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fair connection pool2 Conflicts: activerecord/test/cases/associations/eager_test.rb
| * | | | Make connection pool fair with respect to waiting threads.Patrick Mahoney2012-05-253-1/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The core of this fix is a threadsafe, fair Queue class. It is very similar to Queue in stdlib except that it supports waiting with a timeout. The issue this solves is that if several threads are contending for database connections, an unfair queue makes is possible that a thread will timeout even while other threads successfully acquire and release connections. A fair queue means the thread that has been waiting the longest will get the next available connection. This includes a few test fixes to avoid test ordering issues that cropped up during development of this patch.
| * | | | Cache metadata in advance to avoid extra sql statements while testing.Yasuo Honda2012-05-251-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | Reason: If metadata is not cached extra sql statements will be executed, which causes failures tests with assert_queries().
* | | | | Merge pull request #6709 from amatsuda/sqlite3_version_is_always_gt_125Rafael Mendonça França2012-06-111-1/+1
|\ \ \ \ \ | | | | | | | | | | | | current AR::ConnectionAdapters::SQLite3Adapter supports only SQLite3 ~> 1.3.6
| * | | | | current AR::ConnectionAdapters::SQLite3Adapter supports only SQLite3 ~> 1.3.6Akira Matsuda2012-06-121-1/+1
| | | | | |
* | | | | | TimeZone format is always /[+-]\d{2}:\d{2}/ in Ruby 1.9Akira Matsuda2012-06-121-1/+1
|/ / / / /
* | | | | Address ORA-00911 errors because of the heading underscore.Yasuo Honda2012-06-111-1/+1
| | | | |
* | | | | Fix that #exists? raises ThrowResult when called with an empty limitedBen Woosley2012-06-101-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | reflection. ActiveRecord::FinderMethods#construct_limited_ids_condition will raise ThrowResult if the limited reflection comes back empty. The other callers of #construct_limited_ids_condition handle this exception (more specifically, the callers of construct_relation_for*), but #exists? didn't until now.
* | | | | Add test to column alias in `exists?` SQL.Rafael Mendonça França2012-06-101-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This behavior was added in be4ecdcc87984e9421ff5d5c90d33f475e0fbc01. Closes #1139. Fixes #2553, #1141, #1623 and #2062.