| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
It appears first in `lib/active_record.rb`.
|
|
|
| |
These methods are more expensive than the alternatives, and have strange semantics that are likely undesirable.
|
|
|
|
| |
It was changed by mistake at 428d47adfed8d6aa7b21aec2bf5ad890961c9de3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The focus of this change is to make the API more accessible.
References to method and classes should be linked to make it easy to
navigate around.
This patch makes exzessiv use of `rdoc-ref:` to provide more readable
docs. This makes it possible to document `ActiveRecord::Base#save` even
though the method is within a separate module
`ActiveRecord::Persistence`. The goal here is to bring the API closer to
the actual code that you would write.
This commit only deals with Active Record. The other gems will be
updated accordingly but in different commits. The pass through Active
Record is not completely finished yet. A follow up commit will change
the spots I haven't yet had the time to update.
/cc @fxn
|
| |
|
| |
|
| |
|
|\
| |
| |
| |
| |
| | |
[Doc] Encourage users to user super to override methods.
[ci skip]
|
|/
|
| |
IMO we shouldn't encourage users to use methods they shouldn't need to know about. As Song (in this example) inherits from ActiveRecord, we can use super here instead to get the same effect with the bonus of not knowing how active record actually implements these methods.
|
|
|
|
|
|
|
|
|
|
| |
[fixes #18606]
Make belongs_to use touch over touch_later when running the callbacks.
Add more tests and small method rename
Thanks Jeremy for the feedback.
|
| |
|
| |
|
|
|
|
|
|
| |
Update SecureToken Docs
Add Changelog entry for has_secure_token [ci skip]
|
| |
|
|
|
|
|
| |
value is present. [ci skip]
The way Active Record query methods handle numeric values is a special case, and is not part of Rails's standard definition of present. This update attempts to make this more clear in the docs, so that people don't expect Object#present? to return false if used on a number that is zero.
|
|
|
| |
Update Active Record's attribute query methods documentation to clarify that whether an attribute is present is based on Object#present?. This gives people a place to go see what the exact definition of presence is. [ci skip]
|
|
|
|
| |
full behaviour. [ci skip]
|
| |
|
|
|
|
| |
[ci skip]
|
| |
|
|
|
| |
Documenting a potential source of confusion about how STI classes handle changes.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This refactoring revealed the need for another form of decoration, which
takes a proc to select which it applies to (There's a *lot* of cases
where this form can be used). To avoid duplication, we can re-implement
the old decoration in terms of the proc-based decoration.
The reason we're `instance_exec`ing the matcher is for cases such as
time zone aware attributes, where a decorator is defined in a parent
class, and a method called in the matcher is overridden by a child
class. The matcher will close over the parent, and evaluate in its
context, which is not the behavior we want.
|
|
|
|
|
|
|
| |
This reverts commit dd3ea17191e316aeebddaa7b176f6cfeee7a6365 and add a
regression test.
Fixes #15418
|
|\
| |
| |
| |
| |
| |
| |
| | |
Rename `property` to `attribute`
Conflicts:
activerecord/lib/active_record/attribute_methods/serialization.rb
activerecord/lib/active_record/base.rb
|
| |
| |
| |
| | |
For consistency with https://github.com/rails/rails/pull/15557
|
|/
|
|
|
|
| |
We need to decorate the types lazily. This is extracted to a separate
API, as there are other refactorings that will be able to make use of
it, and to allow unit testing the finer points more granularly.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As a result of all of the refactoring that's been done, it's now
possible for us to define a public API to allow users to specify
behavior. This is an initial implementation so that I can work off of it
in smaller pieces for additional features/refactorings.
The current behavior will continue to stay the same, though I'd like to
refactor towards the automatic schema detection being built off of this
API, and add the ability to opt out of automatic schema detection.
Use cases:
- We can deprecate a lot of the edge cases around types, now that there
is an alternate path for users who wish to maintain the same behavior.
- I intend to refactor serialized columns to be built on top of this
API.
- Gem and library maintainers are able to interact with `ActiveRecord`
at a slightly lower level in a more stable way.
- Interesting ability to reverse the work flow of adding to the schema.
Model can become the single source of truth for the structure. We can
compare that to what the database says the schema is, diff them, and
generate a migration.
|
|
|
|
|
|
| |
transactions.
Closes #14841.
|
|
|
|
| |
Swap Timestamp/Callbacks order in ActiveRecord::Base
|
| |
|
| |
|
| |
|
|
|
|
| |
map to integers in the database, but can be queried by name
|
| |
|
| |
|
|
|
|
| |
I think that these signs are probably mistake.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Allows you to do BaseClass.new(:type => "SubClass") as well as
parent.children.build(:type => "SubClass") or parent.build_child
to initialize an STI subclass. Ensures that the class name is a
valid class and that it is in the ancestors of the super class
that the association is expecting.
|
|
|
|
|
|
|
|
| |
They was extracted from a plugin.
See https://github.com/rails/rails-observers
[Rafael Mendonça França + Steve Klabnik]
|
|\
| |
| |
| |
| | |
Conflicts:
actionpack/lib/action_dispatch/routing/redirection.rb
|
| | |
|
| |
| |
| |
| |
| | |
Thanks @toretore.
https://github.com/rails/rails/commit/9e4c41c903e8e58721f2c41776a8c60ddba7a0a9#commitcomment-2134706
|
|/ |
|