| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
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.
|
|\
| |
| |
| | |
Removing composed_of
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|/
|
|
|
| |
to avoid ORA-02289: sequence does not exist
for `SELECT "BLACK_JOKES_SEQ".NEXTVAL FROM dual`
|
| |
|
| |
|
|\
| |
| | |
Get logic out of db rake tasks, and into classes and objects
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
Minimal implementation that supports db:create SQLite replacement
|
| |
| |
| |
| | |
config.active_record.mass_assignment_sanitizer=
|
| | |
|
| |
| |
| |
| |
| | |
Get rid of ActiveModel::Configuration, make better use of
ActiveSupport::Concern + class_attribute, etc.
|
| |
| |
| |
| |
| |
| |
| | |
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>
|
|\ \
| | |
| | |
| | | |
Add uuid datatype support to PostgreSQL adapter
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | | |
|
|\ \ \
| |/ /
|/| | |
Don't assign the attributes if the list is empty
|
| | | |
|
| | | |
|
| | | |
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Fair connection pool2
Conflicts:
activerecord/test/cases/associations/eager_test.rb
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Reason: If metadata is not cached extra sql statements
will be executed, which causes failures tests with assert_queries().
|
|\ \ \ \
| | | | |
| | | | | |
current AR::ConnectionAdapters::SQLite3Adapter supports only SQLite3 ~> 1.3.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.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This behavior was added in be4ecdcc87984e9421ff5d5c90d33f475e0fbc01.
Closes #1139.
Fixes #2553, #1141, #1623 and #2062.
|
|\ \ \ \
| | | | |
| | | | | |
Fix #6635. We should call Scoping methods, before calling Array methods.
|
| | | | | |
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
|/ / / / |
|