| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
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`
|
|
|
|
|
|
|
|
|
|
|
| |
Historically, update_attribute and update_attributes are similar, but
with one big difference: update_attribute does not run validations.
These two methods are really easy to confuse given their similar
names. Therefore, update_attribute is being removed in favor of
update_column.
See the thread on rails-core here:
https://groups.google.com/forum/?fromgroups#!topic/rubyonrails-core/BWPUTK7WvYA
|
| |
|
|\
| |
| | |
Increase numeric-timestamp precision to nanoseconds
|
| | |
|
|/ |
|
| |
|
|
|
|
| |
to the after_seq when using sequencer.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
things
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
Don't reset inheritance_column when setting explicitly.
|
| | |
|
|/ |
|
|\
| |
| | |
Fix ActiveRecord warning in tests with Marshal
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This apparently fix the warning related to @new_record variable not
being initialized in AR's test suit, when an association is built and
the object is marshalled/loaded.
See these tests in AR's base_test.rb:
test_marshalling_with_associations
test_marshalling_new_record_round_trip_with_associations
Closes #3720.
|
| | |
|
| | |
|
|/
|
|
| |
table_name.
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* master: (30 commits)
Bump tzinfo. 0.3.31 was released on November 6, 2011.
Fix GH #4909. Dependency on TZInfo move from AR to AS.
moving ordered hash to normal hash because ruby 1.9.3 hash defaultly ordered one
Refactored the OrderedHash related stuff
Replaced OrderedHash usage with Ruby 1.9 Hash
Replaced OrderedHash with Hash for ruby 1.9 series
removed unnecessary code
replacing the orderhash with hash for ruby-1.9
Clean up some wording.
Fix typo.
test title changed corresponding to the test
replaced active support ordered hash to ruby hash on active resource
PostgreSQL does not work in the same way of the other adapters
AR::Relation#pluck: improve to work with joins
Fix match docs
Fix attribute_before_type_cast for serialized attributes. Fixes #4837.
Fix failing request test
Fixes in AMo README
Update README to mention lint.
Trim down Active Model API by removing valid? and errors.full_messages
...
|
| | |
|
| | |
|