| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|/ / / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
There are two possible scenarios where the @mass_assignment_options
instance variable can become corrupted:
1. If the assign_attributes doesn't complete correctly, then
subsequent calls to a nested attribute assignment method will use
whatever options were passed to the previous assign_attributes call.
2. With nested assign_attributes calls, the inner call will overwrite
the current options. This will only affect nested attributes as the
attribute hash is sanitized before any methods are called.
To fix this we save the current options in a local variable and then
restore these options in an ensure block.
|
| | | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Notify A User they Have Pending Migrations
|
| | | | | |
| | | | | |
| | | | | | |
can be configured by setting config.active_record.migration. Setting to :page_load will raise an error on each page refresh if there are migrations that are pending. Setting to :page_load is defaulted in development for new applications.
|
| | | | | |
| | | | | |
| | | | | | |
if a rails project needs to be migrated ActiveRecord::Migrator.needs_migration? will be true or false if the current version matches the last version.
|
| |_|/ / /
|/| | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Several tests that passed when run in the order they are loaded
by rake test were failing when run in different sequences due to
problems with the implementation of assert_queries and
assert_no_queries as well as incorrect assumptions made about
how many queries might be executed by a database adapter in
various cases.
|
| | | | |
| | | | |
| | | | |
| | | | | |
because Oracle Adapter does not support foreign keys if :polymorphic => true is used.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Add ActiveRecord::Base#destroy!
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Module#methods are Symbols in Ruby >= 1.9
|
|\ \ \ \ \ \
| |/ / / / /
|/| | | | | |
Resolver tests fail if mysql adapter not installed
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
being able to run the sqlite3 tests without that gem. This fix ensures
the tests will only run if the mysql gem is installed.
A better solution might be to move these tests into the per-adapter tests,
and test each adapter's resolver.
|
|/ / / / / |
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | | |
now we can invoke previously added scope extension methods
|
|\ \ \ \ \
| |_|_|/ /
|/| | | |
| | | | |
| | | | |
| | | | | |
* master-sec:
Strip [nil] from parameters hash. Thanks to Ben Murphy for reporting this!
predicate builder should not recurse for determining where columns. Thanks to Ben Murphy for reporting this
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Thanks to Ben Murphy for reporting this
CVE-2012-2661
|
| |/ / /
|/| | |
| | | |
| | | | |
serialized values to indifferent access.
|
|\ \ \ \
| | | | |
| | | | | |
Fix #5797. Error calling dup method on AR model with serialized field
|
| | | | | |
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
Fix logs name consistency.
|
| | | | | |
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | | |
Merge commit 6f1d9d00ffd9d411b2bd488da4eb92b7e2fd972e
|
| | | | |
| | | | |
| | | | |
| | | | | |
sum allows blocks
|
| |_|/ /
|/| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
I found the next issue between CollectionAssociation `delete`
and `destroy`.
class Person < ActiveRecord::Base
has_many :pets
end
person.pets.destroy(1)
# => OK, returns the destroyed object
person.pets.destroy("2")
# => OK, returns the destroyed object
person.pets.delete(1)
# => ActiveRecord::AssociationTypeMismatch
person.pets.delete("2")
# => ActiveRecord::AssociationTypeMismatch
Adding support for deleting with a fixnum or string like
`destroy` method.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
#6441
An AR ConnectionSpec `wait_timeout` is pre-patch used for three
different things:
* mysql2 uses it for MySQL's own wait_timeout (how long MySQL
should allow an idle connection before closing it), and
defaults to 2592000 seconds.
* ConnectionPool uses it for "number of seconds to block and
wait for a connection before giving up and raising a timeout error",
default 5 seconds.
* ConnectionPool uses it for the Reaper, for deciding if a 'dead'
connection can be reaped. Default 5 seconds.
Previously, if you want to change these from defaults, you need
to change them all together. This is problematic _especially_
for the mysql2/ConnectionPool conflict, you will generally _not_
want them to be the same, as evidenced by their wildly different
defaults. This has caused real problems for people #6441 #2894
But as long as we're changing this, forcing renaming the
ConnectionPool key to be more specific, it made sense
to seperate the two ConnectionPool uses too -- these two
types of ConnectionPool timeouts ought to be able to be
changed independently, you won't neccesarily want them
to be the same, even though the defaults are (currently)
the same.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
XmlMini define the xml 'datatime', but according to
http://www.w3.org/TR/xmlschema-2/#dateTime could be better
change this to 'dateTime' with upper case letter 'T.
So 'DateTime' and 'Time' are redefined from 'datetime' to 'dateTime'
add the changing to the changelog
|
| |/ /
|/| |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This reverts commit d2901f0fc4270a765717ad572d559dc49a56b3a8, reversing
changes made to 525839fdd8cc34d6d524f204528d5b6f36fe410c.
Conflicts:
activerecord/test/cases/connection_pool_test.rb
Reason: This change broke the build (http://travis-ci.org/#!/rails/rails/builds/1391490)
and we don't have any solution until now. I asked the author to try to
fix it and open a new pull request.
|
|\ \ \
| | | |
| | | | |
Support migrating from Hash to HashWithIndifferentAccess for accessing attributes.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
In order to make migration from 3.x apps easier, we should try to
convert
Hash instances to HashWithIndifferentAccess, to allow accessing values
with both symbol and a string. This is follow up to changes in 3c0bf043.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Currently, when saving a frozen record, an exception would be thrown
which causes a rollback. However, there is a bug in active record that
"defrost" the record as a side effect:
>> t = Topic.new
=> #<Topic id: nil, ...>
>> t.freeze
=> #<Topic id: nil, ...>
>> t.save
RuntimeError: can't modify a frozen Hash
>> t.frozen?
=> false
>> t.save
=> true
This patch fixes the bug by explictly restoring the frozen state on the
attributes Hash after every rollback.
|
| | | |
| | | |
| | | |
| | | | |
These variables were issuing some "not used" warnings.
|
|\ \ \ \
| | | | |
| | | | | |
Make connection pool fair with respect to waiting threads.
|
| | | | | |
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
allow the :converter Proc form composed_of to return nil
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This makes it possible to filter invalid input values before they are passed
into the value-object (like empty strings). This behaviour is only relevant
if the :allow_nil options is set to true. Otherwise you will get
the resulting NoMethodError.
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The fix commited in e2a070c was returning the `new_target`, as
a try to return whatever user replaced association with. The
problem is, the resulting association target may be ordered
differently. In such case we want to return the target that
will be later used for that association.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Increase numeric-timestamp precision to nanoseconds
|
| | | | | | |
|
| | | | | | |
|
| |_|_|/ /
|/| | | |
| | | | |
| | | | | |
Bug #6289
|
| |_|/ /
|/| | | |
|
| | | | |
|
|/ / / |
|
|\ \ \
| | | |
| | | | |
Don't allow to destroy readonly models
|
| | | | |
|
|/ / / |
|
|\ \ \
| | | |
| | | |
| | | |
| | | | |
RStankov/relation-from-to-accept-other-relation-objects
Relation#from to accept other Relation objects
|