| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|\ \ \ \
| |/ / /
|/| | | |
Optimize generated ERB to reduce method calls
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
before:
');@output_buffer.append= ( content_icon row[:content] );@output_buffer.safe_concat('
');@output_buffer.safe_concat(' ');@output_buffer.append= ( spinner_img );@output_buffer.safe_concat('
');@output_buffer.safe_concat(' </td>
<td class="content">
');@output_buffer.append= ( content_link row[:content] );@output_buffer.safe_concat('
');@output_buffer.safe_concat(' </td>
<td class="message">
');
after:
';@output_buffer.append=( content_icon row[:content] );@output_buffer.safe_append='
';@output_buffer.append=( spinner_img );@output_buffer.safe_append='
</td>
<td class="content">
';@output_buffer.append=( content_link row[:content] );@output_buffer.safe_append='
</td>
<td class="message">
';
|
| | | | |
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Fix explicit names on multiple file fields
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
If a file field tag is passed the multiple option, it is turned into an
array field (appending "[]"), but if the file field is passed an
explicit name as an option, leave the name alone (do not append "[]").
Fixes #9830
|
|\ \ \ \
| |_|_|/
|/| | |
| | | |
| | | |
| | | |
| | | | |
Correctly parse bigint defaults in PostgreSQL
Conflicts:
activerecord/CHANGELOG.md
|
| | | | |
|
| | | | |
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Association with inverse_of does not set the parent in association building block
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This fixes inconsistency when building children of association
which has inverse_of set properly.
When creating new association object with a block:
parent.association.build do |child|
child.parent.equal?(parent) # false
end
So the block the `child.parent` did not point to the same object.
But when the object is created it points to same instance:
child = parent.association.build
child.parent.equal?(parent) # true
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Avoid calling define_method in CollectionProxy#scope
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
See #9869 and #9929.
The problem arises from the following example:
class Project < ActiveRecord::Base
scope :completed, -> { where completed: true }
end
class MajorProject < Project
end
When calling:
MajorProject.where(tasks_count: 10).completed
This expands to:
MajorProject.where(tasks_count: 10).scoping {
MajorProject.completed
}
However the lambda for the `completed` scope is defined on Project. This
means that when it is called, `self` is Project rather than
MajorProject. So it expands to:
MajorProject.where(tasks_count: 10).scoping {
Project.where(completed: true)
}
Since the scoping was applied on MajorProject, and not Project, this
fails to apply the tasks_count condition.
The solution is to make scoping apply across STI classes. I am slightly
concerned about the possible side-effects of this, but no tests fail and
it seems ok. I guess we'll see.
|
| | | | | | |
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Sort modules in active_record.rb
|
| | |_|/ / /
| |/| | | | |
|
|/ / / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Round off time to a whole second value to compensate for databases
that don't support fractional timestamps. Also add a assertion to
check that the old record is touched when the association is cleared.
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The implementation was using the source class foreign key field instead
of the reflected primary key one to find the old record.
For instance, for this scenario
class Bulb < ActiveRecord::Base
belongs_to :car, :touch => true
end
class Car < ActiveRecord::Base
has_many :bulbs
end
the current implementation was trying to do this query:
Car.where(car_id: X).first
where we should be doing this query:
Car.where(id: X).first
This should hopefully fix the build.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
There's no need to use Hash#merge with a new hash just for setting the
href option to pass it through. Since we're always dealing with a new
html_options hash, we're free to just set the value instead.
|
| | | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Add block support for the mail_to helper
|
| | | | | | |
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Model generator USAGE doc improvement
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
* Added information about syntax for precision/scale of decimals
* Removed incorrect information about being able to set `default`
* Added more examples of usage
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
If we don't use inspect inside the class_eval block then the foreign key
is written without quotes causing us to fetch the foreign key value and
not the column name.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
http://guides.rubyonrails.org/api_documentation_guidelines.html#example-code
[ci skip]
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Collection of small fixes. Check individual commits for background.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
since users just copy and paste and the class name is never changed
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
thanks to @egilburg for suggestion
|
| | | | | | | | |
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
Exclude template files for rdoc API [ci skip]
|
|/ / / / / / / / |
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
benofsky/fix_skipping_object_callback_filters"
This reverts commit c79c6980647eb76bfa52178711fb04ba7e9d403b, reversing
changes made to ba4c27479add60b783a0e623c8a5d176c1dc9043.
This broke all the tests. See https://travis-ci.org/rails/rails/builds/6061839
|
| | | | | | | | |
|
|\ \ \ \ \ \ \ \
| |/ / / / / / /
|/| | | | | | | |
Fixes skipping object callback filters
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
This allows you to skip callbacks that are defined by objects, e.g. for
`ActionController`:
skip_after_filter MySpecialFilter
Previously this didn't work due to a bug in how Rails compared callbacks
in `Callback#matches?`. When a callback is compiled, if it's an object
filter (i.e. not a method, proc, etc.), `Callback` now defines a method on
`@klass` that is derived from the class name rather than `@callback_id`.
So, when `skip_callback` tries to find the appropriate callback to
remove, `Callback` can regenerate the method name for the filter
object and return the correct value for `Callback#matches?`.
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
has_many through obeys order on through association
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
fixes #10016
|
|\ \ \ \ \ \ \ \ \
| |_|_|/ / / / / /
|/| | | | | | | | |
fix private attribute warning
|
| | | | | | | | | |
|
| | | | | | | | | |
|
|\ \ \ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
Removed unused comma after loop variable
|
| | | | | | | | | | |
|
| |/ / / / / / / / |
|
|\ \ \ \ \ \ \ \ \
| |/ / / / / / / /
|/| | | | | | | | |
minor fixes including variable name change and expanded rdoc
|
| | | | | | | | | |
|
| | | | | | | | | |
|