| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
Introduce test on Error#full_message for attribute with underscores; Fix
some typos
|
|
|
|
| |
Type a fixo.
|
|
|
|
|
| |
These tests should be in inheritance_test.rb since its testing a
feature which is implemented in inheritance.rb
|
|
|
|
|
|
|
| |
We moved more and more away from passing options to finder / calculation
methods. The `:distinct` option in `#count` was one of the remaining places.
Since we can now combine `Relation#distinct` with `Relation#count` the option
is no longer necessary and can be deprecated.
|
|
|
|
|
|
|
|
| |
The similarity of `Relation#uniq` to `Array#uniq` is confusing. Since our
Relation API is close to SQL terms I renamed `#uniq` to `#distinct`.
There is no deprecation. `#uniq` and `#uniq!` are aliases and will continue
to work. I also updated the documentation to promote the use of `#distinct`.
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| | |
cache_key consults updated_on timestamp if present
Conflicts:
activerecord/CHANGELOG.md
|
| |
| |
| |
| |
| | |
- Extract max timestamp retrieval for cache_key
- Update changelog for cache_key changes
|
|/
|
|
|
|
|
|
|
|
| |
Calling a literal ActiveRecord::Base.new raises NoMethodError,
since it ends up calling Class.abstract_class? which does not exist.
Similarly, instantiating an actual abstract class hits the database,
when conventionally it should immediately throw NotImplementedError.
ActiveRecord::Base can't be made abstract without breaking many,
many things, so check for it separately.
|
|
|
|
|
| |
object that has not yet been persisted. This behavior follows the
precedent set by update_columns.
|
|
|
|
| |
These are duplicated with the tests which are in relations_test.rb
|
| |
|
| |
|
| |
|
|\
| |
| | |
remove meaningless AS::FrozenObjectError
|
| | |
|
|/ |
|
| |
|
|
|
|
|
| |
Conflicts:
activerecord/test/cases/base_test.rb
|
|
|
|
|
|
|
| |
This can be done using the class attribute cache_timestamp_format
Conflicts:
railties/guides/source/configuring.textile
|
|
|
|
|
|
| |
Conflicts:
activerecord/test/models/bulb.rb
activerecord/test/schema/schema.rb
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
In the end I think the pain of implementing this seamlessly was not
worth the gain provided.
The intention was that it would allow plain ruby objects that might not
live in your main application to be subclassed and have persistence
mixed in. But I've decided that the benefit of doing that is not worth
the amount of complexity that the implementation introduced.
|
| |
|
| |
|
|
|
|
|
|
|
| |
Due to its lack of thread safety, we're deprecating this, and it
will be removed in Rails 4.1.
Fixes #4060.
|
|
|
|
|
|
| |
The string_to_dummy_time method was blindly parsing the dummy time string
with Date._parse which returns a hash for the date part regardless
of whether the time part is an invalid time string.
|
|
|
|
|
| |
All tests with a custom inheritance_column use the `Vegtable` model.
The field ruby_type on the Company models is no longer needed
|
|
|
|
|
|
|
|
| |
This test https://github.com/rails/rails/blob/master/activerecord/test/cases/base_test.rb#L381
is failing because is not setting `CreditCard.pluralize_table_name` to `false`.
In this case, i prefer to change to another model that is not in the `GUESSED_CLASSES`
array.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
ActiveRecord::ConnectionAdapters::Column#microseconds did an unnecessary
conversion to from Rational to float when calculating the integer number
of microseconds. Some terminating decimal numbers in base10 are
repeating decimal numbers in base2 (the format of float), and
occasionally this causes a rounding error.
Patch & explanation originally from Logan Bowers.
|
|
|
|
|
| |
On reflection, it seems like a bit of a weird method to have on
ActiveRecord::Base, and it shouldn't be needed most of the time anyway.
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 14fc8b34521f8354a17e50cd11fa3f809e423592.
Reason: we need to discuss a better path from this removal.
Conflicts:
activerecord/lib/active_record/reflection.rb
activerecord/test/cases/base_test.rb
activerecord/test/models/developer.rb
|
|
|
|
|
|
|
| |
It doesn't serve much purpose now that ActiveRecord::Base.all returns a
Relation.
The code is moved to active_record_deprecated_finders.
|
|
|
|
|
|
|
|
|
|
|
| |
Previously it returned an Array.
If you want an array, call e.g. `Post.to_a` rather than `Post.all`. This
is more explicit.
In most cases this should not break existing code, since
Relations use method_missing to delegate unknown methods to #to_a
anyway.
|
|
|
|
|
|
|
|
|
| |
Moved logic from class_of_active_record_descendant(class) to the
base_class method. This method was confusing because it required
an argument, but that argument was 'self'.
Moved base_class tests to inheritance_test.rb and added some test
coverage for some untested cases.
|
|
|
|
| |
Closes #1190
|
|
|
|
|
|
|
| |
Integration's definition of #to_param must override
Conversion's. Otherwise, there is a regression from
3.1 in the behavior of a non-persisted AR::Base instance
which nevertheless has an id.
|
|
|
|
|
|
|
|
|
|
|
| |
Since composed_of was removed in 051747449e7afc817c599e4135bc629d4de064eb,
these tests were working "by mistake", due to the matching "address"
string in the error message, but with a different error message than the
expected multiparameter assignment error.
Since "address" is not an attribute from Customer anymore, the error was
"undefined method klass for nil", where nil was supposed to be the
column object.
|
|
|
|
|
| |
All other multiparameter assignment tests are in the same file, so it
makes sense to have all of them here.
|
|
|
|
|
|
| |
test starts with a clean slate.
Fixes #6867.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit needs to be reverted because it introduces difficulties when
using sqlite3 in development and other databases in production. This
happens because when you create time column in sqlite3, it's dumped as
datetime in schema.rb file.
This reverts commit 57d534ee9e441d078fcc161c0c78ebaa5aacd736, reversing
changes made to 20f049fb50daee0c5e5a69b55b529af5737e8e3f.
Conflicts:
activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb
|
|\
| |
| |
| | |
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`
|