Commit Graph

14548 Commits

Author SHA1 Message Date
Jan
4942b41267 Fix typo in CHANGELOG 2015-12-18 22:25:57 +01:00
eileencodes
099ddfdefd Add CHANGELOG headers for Rails 5.0.0.beta1 2015-12-18 15:58:25 -05:00
eileencodes
7eae0bb88e Change alpha to beta1 to prep for release of Rails 5
🎉 🍻
2015-12-18 12:14:09 -05:00
Matthew Draper
f07211f4f4 Merge pull request #22658 from greysteil/handle-specified-schema-in-index-remove
Handle specified schemas when removing a Postgres index
2015-12-19 02:48:23 +10:30
David Heinemeier Hansson
ea4f0e2bab Refer to rails command instead of rake in a bunch of places
Still more to do. Please assist!
2015-12-18 13:01:10 +01:00
Grey Baker
cda0c1f6a7 Handle specified schemas when removing a Postgres index 2015-12-18 10:07:10 +00:00
Matthew Draper
2750b1b417 Merge pull request #22653 from matthewd/find_array_ordered
ActiveRecord::Base#find(array) returning result in the same order as the array passed
2015-12-18 16:42:30 +10:30
Matthew Draper
503255d21b These limits are now implicit 2015-12-18 16:21:21 +10:30
Matthew Draper
04309aee82 Implement limit & offset for ourselves
We know the query will return exactly one row for each entry in the
`ids` array, so we can do all the limit/offset calculations on that
array, in advance.

I also split our new ordered-ids behaviour out of the existing
`find_some` method: especially with this change, the conditionals were
overwhelming the actual logic.
2015-12-18 15:54:04 +10:30
Matthew Draper
e0e918609f Merge pull request #20815 from byroot/do-not-include-column-limit-if-it-is-default
Do not include column limit in schema.rb if it matches the default
2015-12-18 14:52:05 +10:30
Matthew Draper
da6713fd03 Merge pull request #22623 from greysteil/support-passing-schema-name-to-indexes
Support passing the schema name prefix to `conenction.indexes`
2015-12-18 14:17:50 +10:30
Matthew Draper
c316ce9ba4 Merge pull request #19456 from greysteil/index-exists-behaviour
Ignore index name in `index_exists?` when not passed a name to check for
2015-12-18 14:13:46 +10:30
Matthew Draper
4a58aef7e3 Merge pull request #22642 from seuros/remove-mysql-adapter
Remove legacy mysql adapter
2015-12-18 13:51:04 +10:30
Rafael Mendonça França
b611350e7c Use released arel 2015-12-17 18:11:29 -02:00
Eric Krause
2e16cc9e92 Expanding the documentation for collection=objects for has_many :through [ci-skip] 2015-12-17 12:00:30 -07:00
Sean Griffin
7f86ed8b36 Call the new point behavior :point, not :rails_5_1_point
Since the attributes API is new in Rails 5, we don't actually need to keep
the behavior of `attribute :point`, as it's not a breaking change.
2015-12-17 09:36:59 -07:00
Abdelkader Boudih
fb24d0ed6c Remove legacy mysql adapter 2015-12-17 15:54:57 +00:00
Genadi Samokovarov
008e5ab76d Pass over the ApplicationRecord changelog entry
The changelog entry for ApplicationRecord was a bit confusing. Thank you
guys for helping me get it in a better shape.

[ci skip]
2015-12-17 10:42:53 +01:00
Grey Baker
d927f35bf0 Support passing the schema name prefix to conenction.indexes
Support passing the schema name as a prefix to table name in
`ConnectionAdapters::SchemaStatements#indexes`. Previously the prefix would
be considered a full part of the index name, and only the schema in the
current search path would be considered.
2015-12-17 09:25:50 +00:00
yuuji.yaginuma
dfa51d4ff4 fix typo in method name [ci skip]
It was changed by mistake at 428d47adfed8d6aa7b21aec2bf5ad890961c9de3
2015-12-17 13:49:01 +09:00
Rafael Mendonça França
5082cce6e3 Revert "Merge pull request #22615 from kamipo/join_to_delete_is_same_as_join_to_update"
This reverts commit 4d06ea9a829de8f6f5a345589828e182eacab6a3, reversing
changes made to e9d15072a94e2ae4dec5b7a121c84a5db38547b8.

Reason: This will break oracle-enhanced, see
3c42131db8/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb (L1254)
2015-12-17 02:07:27 -02:00
Rafael França
4d06ea9a82 Merge pull request #22615 from kamipo/join_to_delete_is_same_as_join_to_update
`join_to_delete` is same as `join_to_update`
2015-12-17 02:03:07 -02:00
Ryuta Kamizono
59a030954d join_to_delete is same as join_to_update 2015-12-17 12:08:00 +09:00
Rafael Mendonça França
342221b073 Make sure File.exist? run in the root of the application 2015-12-16 21:29:08 -02:00
Rafael Mendonça França
7ed68b1611 Do not define attributes_with_index as a Thor task
All public methods are tasks, so we need to move it to protected
visibility.
2015-12-16 21:05:03 -02:00
Rafael Mendonça França
dee0053815 Remove dead code 2015-12-16 21:02:45 -02:00
Sean Griffin
7fb47a8559 Don't over-specify types in our tests
This test was failing when run on Windows using PostgreSQL. Depending on
the OS (and 32 vs 64 bit), this type could be a `BigNum`. We could loosen
the assertion to `Numeric`, but if the value is equal to the expected, and
responds to `bitlength` properly, who cares?
2015-12-16 15:17:36 -07:00
Sean Griffin
bc39fa07ae Fix test failures on Windows
Unlike unix, the TZ variable on Windows does not look at a database. It is
always expected to be in the form {Standard Time
Abbreviation}{UTC-Offset}{Daylight Time Abbriviation}. This changes the
relevant tests to use the Windows form when run from Windows.
2015-12-16 13:33:22 -07:00
Sean Griffin
f0f4f543c8 Fix test failure on Windows
When this test was run on Windows, the database file would still be in
use, and `File.unlink` would fail. This would cause the temp directory to
be unable to be removed, and error out. By disconnecting the connection
when finished, we can avoid this error.
2015-12-16 12:03:40 -07:00
Rafael França
1d7d8062b2 Merge pull request #22567 from gsamokovarov/introduce-application-record
Introduce ApplicationRecord, an Active Record layer supertype
2015-12-16 14:37:57 -02:00
Rafael França
d953512360 Merge pull request #22605 from tonyta/delete-dead-comments
Delete dead code comments
2015-12-16 14:23:31 -02:00
Rafael França
b7a7e82207 Merge pull request #22598 from yui-knk/deprecate_string_callback
Deprecate passing string to define callback.
2015-12-16 13:54:02 -02:00
yui-knk
21f4017fd9 Deprecate passing string to define callback. 2015-12-16 19:56:20 +09:00
Genadi Samokovarov
2067fff9e3 Introduce ApplicationRecord, an Active Record layer supertype
It's pretty common for folks to monkey patch `ActiveRecord::Base` to
work around an issue or introduce extra functionality. Instead of
shoving even more stuff in `ActiveRecord::Base`, `ApplicationRecord` can
hold all those custom work the apps may need.

Now, we don't wanna encourage all of the application models to inherit
from `ActiveRecord::Base`, but we can encourage all the models that do,
to inherit from `ApplicationRecord`.

Newly generated applications have `app/models/application_record.rb`
present by default. The model generators are smart enough to recognize
that newly generated models have to inherit from `ApplicationRecord`,
but only if it's present.
2015-12-16 10:30:09 +01:00
Tony Ta
f7014c5bb6 deletes commented code introduced in db045db (initial commit) 2015-12-15 23:15:57 -08:00
Grey Baker
8ceb883b06 Support removing custom-names indexes when only specifying column names 2015-12-15 21:06:07 +00:00
Jeremy Daer
8391007b7c Merge pull request #22562 from sblackstone/master
Allow users to pass flags from database.yml
2015-12-15 11:23:04 -07:00
Grey Baker
9771f5e178 Ignore index name in index_exists? when not passed a name to check for 2015-12-15 17:36:09 +00:00
Eileen M. Uchitelle
e73fe1dd8c Merge pull request #22596 from y-yagi/remove_extra_space_from_deprecation_msg
remove extra spaces from deprecation message
2015-12-15 09:07:19 -05:00
Stephen Blackstone
46fe546c5f Allow users to pass flags from database.yml
Fix white-space

Add test case demonstrating flags are received by the adapter
2015-12-15 06:59:28 -05:00
yuuji.yaginuma
08780eff79 remove extra spaces from deprecation message
```
# before
DEPRECATION WARNING:               Time columns will become time zone aware in Rails 5.1. This
              still causes `String`s to be parsed as if they were in `Time.zone`,
              and `Time`s to be converted to `Time.zone`.

              To keep the old behavior, you must add the following to your initializer:

                  config.active_record.time_zone_aware_types = [:datetime]

              To silence this deprecation warning, add the following:

                  config.active_record.time_zone_aware_types << :time
```

```
# after
DEPRECATION WARNING: Time columns will become time zone aware in Rails 5.1. This
still causes `String`s to be parsed as if they were in `Time.zone`,
and `Time`s to be converted to `Time.zone`.

To keep the old behavior, you must add the following to your initializer:

    config.active_record.time_zone_aware_types = [:datetime]

To silence this deprecation warning, add the following:

    config.active_record.time_zone_aware_types << :time
```
2015-12-15 19:32:20 +09:00
Matthew Draper
97c77160cd Use a real migration version number in docs
Even though this means more things to change when we bump after a
release, it's more important that our examples are directly copyable.
2015-12-15 17:18:10 +10:30
Matthew Draper
6d2469daa6 Schema uses current migration API 2015-12-15 17:18:09 +10:30
Matthew Draper
badaf353ba In 4.2 migrations, timestamps defaulted to null: true
.. it also showed a deprecation warning, but we obviously needn't retain
that.
2015-12-15 17:18:09 +10:30
Matthew Draper
f37d92c410 Find the delegate, even in a deeper inheritance tree 2015-12-15 17:18:09 +10:30
Matthew Draper
a6d4e5e532 Internal test migrations use the private 'Current' version
Apart from specific versioning support, our tests should focus on the
behaviour of whatever version they're accompanying, regardless of when
they were written.

Application code should *not* do this.
2015-12-15 17:18:09 +10:30
Matthew Draper
c0af95e0ab Use a deliberately-invalid migration version in all doc examples
If we use a real version, at best that'll be an onerous update required
for each release; at worst, it will encourage users to write new
migrations against an older version than they're using.

The other option would be to leave these bare, without any version
specifier. But as that's just a variant spelling of "4.2", it would seem
to raise the same concerns as above.
2015-12-15 17:18:09 +10:30
Matthew Draper
6940dc860c Add migration versioning via Migration subclasses 2015-12-15 17:18:08 +10:30
Matthew Draper
de2135209f Ensure uuid-ossp extension is present before we rely on it 2015-12-15 16:48:20 +10:30
Sean Griffin
4ecabed2f6 Revert "Perform a more efficient query in Relation#any?"
This reverts commit 6d5b1fdf55611de2a1071c37544933bb588ae88e.

`eager_load` and `references` can include hashes, which won't match up
with `references`

A test case has been added to demonstrate the problem
2015-12-14 10:05:53 -07:00