| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
Preserve Array#take(n) behaviour of HasManyAssociation
|
| | |
|
|\ \
| | |
| | | |
Move `UnknownAttributeError` to a more sane namespace
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The name `ActiveModel::AttributeAssignment::UnknownAttributeError` is
too implementation specific so let's move the constant directly under
the ActiveModel namespace.
Also since this constant used to be under the ActiveRecord namespace, to
make the upgrade path easier, let's avoid raising the former constant
when we deal with this error on the Active Record side.
|
| | | |
|
|\ \ \
| | | |
| | | | |
[ci skip] Fix a typo for PostgreSQL text limit, GB instead of Gb.
|
| | | | |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
We only set the state on the record if that condition is `false` in the
first place, so we dont need to call that again. Also that call is
expensive, follow benchmark with before and after this change:
```
Calculating -------------------------------------
persisted? 15.272k i/100ms
-------------------------------------------------
persisted? 350.119k (± 4.6%) i/s - 1.756M
```
```
Calculating -------------------------------------
persisted? 25.988k i/100ms
-------------------------------------------------
persisted? 1.294M (± 5.3%) i/s - 6.445M
```
(benchmark borrowed from 57d35b2bf9e48173a5f97ccff5e6897f0c46411f)
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | | |
JuanitoFatas/doc/active_record/connection_adapters/abstract/schema_definitions.rb
Clarify that t.references and t.belongs_to are interchangeable. [ci skip]
|
| |/ / / |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
directly
calling `sync_with_transaction_state` is not fast, so if we call it
once, we can improve the performance of the `persisted?` method. This
is important because every call to `url_for(model)` will call
`persisted?`, so we want that to be fast.
Here is the benchmark:
```ruby
require 'active_record'
ActiveRecord::Base.establish_connection adapter: "sqlite3", database: ":memory:"
ActiveRecord::Base.connection.instance_eval do
create_table(:articles)
end
class Article < ActiveRecord::Base; end
article = Article.new.tap(&:save!)
Benchmark.ips do |x|
x.report("persisted?") do
article.persisted?
end
end
```
Before this patch:
```
$ bundle exec ruby -rbenchmark/ips persisted.rb
Calculating -------------------------------------
persisted? 3.333k i/100ms
-------------------------------------------------
persisted? 51.037k (± 8.2%) i/s - 253.308k
```
After:
```
$ bundle exec ruby -rbenchmark/ips persisted.rb
Calculating -------------------------------------
persisted? 7.172k i/100ms
-------------------------------------------------
persisted? 120.730k (± 5.1%) i/s - 602.448k
```
|
| | | |
| | | |
| | | |
| | | |
| | | | |
depth is always 0, so the index will always be false. No reason to
create the instance variable if it isn't used
|
|\ \ \ \
| |/ / /
|/| | | |
Rake restart task no longer loads entire Rails environment when run
|
|/ / /
| | |
| | |
| | |
| | | |
The restart task does not need access to models or other classes and
helpers from the application environment.
|
| | |
| | |
| | |
| | | |
[Robin Dupret + Rafael Mendonça França]
|
|\ \ \
| | | |
| | | | |
Improve guides [ci skip]
|
| | | | |
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
[ci skip] Add code example for MailHelper#block_format documentation
|
| | | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Nit pick the byebug settings guide for default values [ci skip]
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
In #19097 we had a discussion where we decided to change `byebug`
settings sections default part to actually say `defaults`.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Web Console documentation for the upcoming 2.1 release [ci skip]
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
With the upcoming 2.1 [web-console release], I have tweaked the existing
documentation a bit. I tried to focus on the spawning console use case,
because I think a lot of people overlook that.
Tried to explain it as best as I can, however, my English and prose
aren't my best skills :) If you guys can chime in and help me improve
the wording, I would be extremely grateful.
There has been some configuration default changes. For example, the
whitelisted IPs always include IPv4 and IPv6 localhosts now and this
wasn't the case in 2.0. I think a lot of people got bitten by it, that's
why I changed it. I'm a bit confused on how to document this. Should I
just document the latest version, I don't think I can expect all the
people reading the guide to be on it.
[web-console release]: https://github.com/rails/web-console/pull/110
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
On guides, correcting incorrect controller name used on routing.md.
|
|/ / / / / / /
| | | | | | |
| | | | | | | |
On "Controller Namespaces and Routing" section of the "Rails Routing from the Outside In" , the examples are using "AritclesController" as an example of a controller, to show different organizers. But on the line 232, it incorrectly uses "PostsController" instead of "AritclesController".
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Use include? instead of in? for Enumerable#without.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
[egilburg]
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
[docs fix] Composite index is actually [:imageable_type, :imageable_id]
|
| | | | | | | | | |
|
| |/ / / / / / /
|/| | | | | | | |
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
As far as I can tell nobody is setting this variable.
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
Include object inclusion for enumerable test.
|
|/ / / / / / / / |
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
Add Enumerable#without
|
| | | | | | | | | |
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
`@reflects_state[depth+1]` will always be nil because we haven't made a
method call that would make it true yet.
|
| | | | | | | | | |
|
| | | | | | | | | |
|
|\ \ \ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
Removing unused mailer templates
|
| | | | | | | | | | |
|
| |/ / / / / / / /
|/| | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
```ruby
article = Article.new.tap(&:save!)
view.url_for article
result = ObjectSpace::AllocationTracer.trace do
3000.times { view.url_for article }
end
p ObjectSpace::AllocationTracer.allocated_count_table[:T_STRING] / 3000
```
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
I found that nil values were being incorrectly sent to
`parse_nested_query` in Rack. Originally it was thought that Rails was
doing something incorrect but it was actually rack-test. This was fixed
in brynary/rack-test@4a4b2c1 and is no longer an issue. This commit
bumps rack-test in Rails so changes to Rack don't cause failures.
See rack/rack#813 for more information.
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
_generate_paths_by_default wasn't used in AD::Routing::UrlFor, so we
should be able to move it where it is used in AV::Routing
|
|\ \ \ \ \ \ \ \ \
| |/ / / / / / / /
|/| / / / / / / /
| |/ / / / / / / |
[docs fix] Indexing a polymorphic assoc adds index on type and id
|
|/ / / / / / / |
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
[ci skip] Fix fenced code block lang
|
|/ / / / / / / |
|
|\ \ \ \ \ \ \ |
|