aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/errors.rb
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #17019 from yuki24/add-class-name-to-unknown-attr-errorYves Senn2014-10-201-1/+1
|\ | | | | | | Message on AR::UnknownAttributeError should include the class name of a record
| * AR::UnknownAttributeError should include the class name of a recordYuki Nishijima2014-10-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This would be helpful if 2 models have an attribute that has a similar name to the other. e.g: before: User.new(name: "Yuki Nishijima", projects_attributes: [name: "kaminari"]) # => ActiveRecord::UnknownAttributeError: unknown attribute: name after: User.new(name: "Yuki Nishijima", projects_attributes: [name: "kaminari"]) # => ActiveRecord::UnknownAttributeError: unknown attribute on User: name
* | AR::UnknownAttributeError should include the class name of a recordYuki Nishijima2014-10-201-1/+1
|/ | | | | | | | | | | | | | | This would be helpful if 2 models have an attribute that has a similar name to the other. e.g: before: User.new(name: "Yuki Nishijima", projects_attributes: [name: "kaminari"]) # => ActiveRecord::UnknownAttributeError: unknown attribute: name after: User.new(name: "Yuki Nishijima", projects_attributes: [name: "kaminari"]) # => ActiveRecord::UnknownAttributeError: unknown attribute on User: name
* s/variable supplied/value supplied [ci skip]Zachary Scott2014-06-131-2/+1
|
* Reword PreparedStatementInvalid example, and use values instead ofZachary Scott2014-06-131-4/+3
| | | | | variables [ci skip] Thanks to @matthewd for the excellent feedback! :heart:
* Copy edits and code font wrap for Active Record [ci skip]Zachary Scott2014-06-131-15/+19
|
* Formatting of content from b1db615 [ci skip]Zachary Scott2014-05-281-3/+7
|
* Initial doc for TransactionIsolationError [ci skip]Gaurav Sharma2014-05-281-0/+3
|
* Clarify 'database does not exist' message and implementation.Jeremy Kemper2014-04-011-9/+1
| | | | | | | | | | | * Clarify what the situation is and what to do. * Advise loading schema using `rake db:setup` instead of migrating. * Use a rescue in the initializer rather than extending the error message in-place. * Preserve the original backtrace of other errors by using `raise` rather than raising again with `raise error`. References 0ec45cd15d0a2f5aebc75e23d841b6c12f3ba763
* Tell how to Create a Database in Error Messageschneems2013-12-231-0/+12
| | | | | | | | | | | | | | | | Currently if you attempt to use a database that does not exist you get an error: ``` PG::ConnectionBad FATAL: database "db_error" does not exist ``` The solution is easy, create and migrate your database however new developers may not know these commands by memory. Instead of requiring the developer to search for a solution, tell them how to fix the problem in the error message: ``` ActiveRecord::NoDatabase: FATAL: database "db_error" does not exist Run `$ bin/rake db:create db:migrate` to create your database ``` Active Record should not know about `rake db:migrate` so this additional information needs to come from the railtie. Potential alternative implementation suggestions are welcome.
* Spelling and Grammar checksAkshay Vishnoi2013-12-121-1/+1
|
* Merge pull request #10561 from Empact/nix-throwresultJon Leighton2013-06-071-4/+0
|\ | | | | Rather than raising ThrowResult when construct_limited_ids_conditions comes up empty, set the relation to NullRelation and rely on its results.
| * Rather than raising ThrowResult when construct_limited_ids_conditions comes ↵Ben Woosley2013-05-101-4/+0
| | | | | | | | | | | | up empty, set the relation to NullRelation and rely on its results. This will help avoid errors like 2fcafee250ee2, because in most cases NullRelation will do the right thing. Minor bonus is avoiding the use of exceptions for flow control.
* | Add more data to AR::UnknownAttributeErrorBogdan Gusiev2013-05-161-0/+9
|/ | | | | | | | | begin Topic.new("hello" => "world") rescue ActiveRecord::UnknownAttributeError => e e.record # => #<Topic ... > e.attribute # => "hello" end
* StatementInvalid takes WrappedDatabaseException's placeJeremy Kemper2013-04-281-10/+11
|
* 1.9 Syntax related changesAvnerCohen2012-11-101-1/+1
|
* copy edits [ci skip]Vijay Dev2012-11-031-6/+3
|
* update AR::ImmutableRelation documentation [ci skip]Francesco Rodriguez2012-10-261-0/+14
|
* Support for specifying transaction isolation levelJon Leighton2012-09-211-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If your database supports setting the isolation level for a transaction, you can set it like so: Post.transaction(isolation: :serializable) do # ... end Valid isolation levels are: * `:read_uncommitted` * `:read_committed` * `:repeatable_read` * `:serializable` You should consult the documentation for your database to understand the semantics of these different levels: * http://www.postgresql.org/docs/9.1/static/transaction-iso.html * https://dev.mysql.com/doc/refman/5.0/en/set-transaction.html An `ActiveRecord::TransactionIsolationError` will be raised if: * The adapter does not support setting the isolation level * You are joining an existing open transaction * You are creating a nested (savepoint) transaction The mysql, mysql2 and postgresql adapters support setting the transaction isolation level. However, support is disabled for mysql versions below 5, because they are affected by a bug (http://bugs.mysql.com/bug.php?id=39170) which means the isolation level gets persisted outside the transaction.
* Fixes #6825, adds tests covering cases and error possibilities, also changes ↵Mauricio Linhares2012-06-271-7/+3
| | | | SQLite3 driver to correctly generate a time column instead of datetime
* disallow mutating a relation once loadedJon Leighton2012-06-221-0/+3
|
* + ActiveRecord::Base#destroy!Marc-Andre Lafortune2012-06-061-0/+4
|
* Consider attempted action in exception message of ActiveRecord::StaleObjectErrorChristian Bäuerlein2011-10-141-4/+5
|
* Includes stale record in StaleObjectErrorChristian Bäuerlein2011-10-141-0/+9
|
* Raise an exception on unknown primary key inside AssociationReflection.Jon Leighton2011-10-051-0/+13
| | | | | An association between two models cannot be made if a relevant key is unknown, so fail fast rather than generating invalid SQL. Fixes #3207.
* Revert "Raise error on unknown primary key."Jon Leighton2011-10-051-14/+0
| | | | This reverts commit ee2be435b1e5c0e94a4ee93a1a310e0471a77d07.
* Raise error on unknown primary key.Jon Leighton2011-10-051-0/+14
| | | | | If we don't have a primary key when we ask for it, it's better to fail fast. Fixes GH #2307.
* :conditions => whereAkira Matsuda2011-07-081-1/+1
|
* find(:all) => allAkira Matsuda2011-07-081-1/+1
|
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-4/+4
| | | | 's/[ \t]*$//' -i {} \;)
* ensuring that description does not exceed 100 columnsNeeraj Singh2010-08-021-5/+9
|
* Adds title.Rizwan Reza2010-06-151-0/+3
|
* Make many parts of Rails lazy. In order to facilitate this,wycats2010-03-071-0/+165
add lazy_load_hooks.rb, which allows us to declare code that should be run at some later time. For instance, this allows us to defer requiring ActiveRecord::Base at boot time purely to apply configuration. Instead, we register a hook that should apply configuration once ActiveRecord::Base is loaded. With these changes, brings down total boot time of a new app to 300ms in production and 400ms in dev. TODO: rename base_hook