| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|\ \
| |/
|/| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit vastly reduces the impact of auto
explain logging when enabled, while keeping
a negligible cost when disabled.
The first implementation was based on the idea
of subscribing to "sql.active_record" when
needed, and unsubscribing once done. This is
the idea behind AR::Relation#explain. Subscribe,
collect, unsubscribe.
But with the current implementation of notifications
unsubscribing is costly, because it wipes an internal
cache and that puts a penalty on the next event.
So we are switching to an approach where a long-running
subscriber is listening. Instead of collecting the
queries with a closure in a dedicated subscriber, now
we setup a thread local.
If the feature is disabled by setting the threshold
to nil, the subscriber will call a method that does
nothing. That's totally cheap.
|
|/ |
|
|
|
|
|
|
|
| |
Rationale: As discussed with José and Jon, this convenience
shortcut is not clearly justified and it could let the user
thing the disabled EXPLAINs are related to the model instance
rather than being globally disabled.
|
| |
|
| |
|
|
|
|
| |
This is good because it reduces duplication.
|
|
|
|
| |
This makes me happy!
|
|
|
|
|
|
|
|
| |
fresh_when/stale? conditional get methods from Action Pack"
Needless indirection with no added value.
This reverts commit 535853e83b9092078035a5abb2aa242fba815c05.
|
|
|
|
| |
fresh_when/stale? conditional get methods from Action Pack
|
|
|
|
| |
changes to attribute serialization.
|
|
|
|
|
|
|
| |
Implement a mini state machine for serialized attributes. This means we
do not have to deserialize the values upon initialization, which means
that if we never actually access the attribute, we never have to
deserialize it.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This only existed to support methods like `set_table_name` in Active
Record, which are themselves being deprecated.
|
|
|
|
| |
using self.foo=
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
method.
|
|\
| |
| | |
association methods are now generated in modules
|
| | |
|
| | |
|
|/ |
|
| |
|
|
|
|
|
|
|
| |
"Returns true if the specified attribute has been set by the user or by
a database load and is neither nil nor empty?"
Fixes #1613
|
| |
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
'Type' is a reserved column for STI. Changed conditions example to
avoid using that column name as an example. The example isn't
STI-related (and mentioning STI here is needless clutter), so changing
to avoid accidentally encouraging users to use 'type' as a column name
for other purposes.
|
|/
|
|
| |
stores [DHH]
|
|
|
|
| |
This reverts commit ee2be435b1e5c0e94a4ee93a1a310e0471a77d07.
|
|
|
|
|
| |
If we don't have a primary key when we ask for it, it's better to fail
fast. Fixes GH #2307.
|
|
|
|
| |
Closes #2807.
|
|
|
|
|
| |
For consistency with find_or_initialize_by. Also remove first_or_build
alias.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes a situation I encountered where a subclass would cache the
name of a generated attribute method in @_defined_class_methods. Then,
when the superclass has it's attribute methods undefined, the subclass
would always have to dispatch through method_missing, because the
presence of the attribute in @_defined_class_methods would mean that it
is never generated again, even if undefine_attribute_methods is called
on the subclass.
There various other confusing edge cases like this. STI classes share
columns, so let's just keep all the attribute method generation state
isolated to the base class.
|
|
|
|
|
|
|
|
|
|
| |
Active Record.
This let's you write things like:
User.where(:first_name => "Scarlett").first_or_create!(:last_name => "Johansson", :hot => true)
Related to #2420.
|
| |
|
| |
|
|
|
|
| |
under eager_autoload. Due to the requires in that file, this caused ConnectionSpecification to be loaded, which references ActiveRecord::Base, which means the database connection is established. We do not want to connect to the database when Active Record is loaded, only when ActiveRecord::Base is first referenced by the user.
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
RELEASING_RAILS.rdoc
actionpack/lib/sprockets/railtie.rb
actionpack/test/template/sprockets_helper_test.rb
activerecord/test/cases/calculations_test.rb
railties/guides/source/3_1_release_notes.textile
railties/guides/source/active_resource_basics.textile
railties/guides/source/command_line.textile
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
forms"
Reason: The hash form is secure, and preferred over the array form if possible.
This reverts commit 6dc749596c328c44c80f898d5fa860fff6cab783.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
for generating SQL. This improves the code architecture generally, and solves some problems with marshalling. Adapter authors please take note: you now need to define an Adapter.visitor_for method, but it degrades gracefully with a deprecation warning for now.
|