aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb8
-rw-r--r--activerecord/CHANGELOG.md78
-rw-r--r--railties/lib/rails/commands/dbconsole.rb15
3 files changed, 58 insertions, 43 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index be54d43172..a8be77f46d 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -244,12 +244,10 @@ module ActionDispatch
def app(blocks)
if to.respond_to?(:call)
Constraints.new(to, blocks, false)
+ elsif blocks.any?
+ Constraints.new(dispatcher(defaults), blocks, true)
else
- if blocks.any?
- Constraints.new(dispatcher(defaults), blocks, true)
- else
- dispatcher(defaults)
- end
+ dispatcher(defaults)
end
end
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index 2140b1ea83..a6ed8cdb06 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -7,7 +7,7 @@
to synchronize the schema. Plugins can use this task as a hook to
provide custom behavior after the schema has been loaded.
- NOTE: `test:prepare` runs before the schema was synchronized.
+ NOTE: `test:prepare` runs before the schema is synchronized.
Fixes #17171, #15787.
@@ -29,12 +29,11 @@
*Yves Senn*
-* Fix includes on association with a scope containing joins along with conditions
- on the joined assoiciation.
+* Fix preloading of associations with a scope containing joins along with
+ conditions on the joined association.
*Siddharth Sharma*
-
* Add `Table#name` to match `TableDefinition#name`.
*Cody Cutrer*
@@ -95,7 +94,7 @@
*Yuki Nishijima*
-* Fix regression causing `after_create` callbacks to run before associated
+* Fix a regression causing `after_create` callbacks to run before associated
records are autosaved.
Fixes #17209.
@@ -192,7 +191,7 @@
*Yves Senn*
-* Fixed a regression where whitespaces were stripped from DISTINCT queries in
+* Fix a regression where whitespaces were stripped from DISTINCT queries in
PostgreSQL.
*Agis Anastasopoulos*
@@ -206,7 +205,7 @@
*Agis Anastasopoulos*
-* Fixed `Relation#exists?` to work with polymorphic associations.
+* Fix `Relation#exists?` to work with polymorphic associations.
Fixes #15821.
@@ -228,7 +227,7 @@
*arthurnn*
-* Fixed an issue where custom accessor methods (such as those generated by
+* Fix an issue where custom accessor methods (such as those generated by
`enum`) with the same name as a global method are incorrectly overridden
when subclassing.
@@ -292,7 +291,7 @@
*Yves Senn*
-* Fixed automatic maintaining test schema to properly handle sql structure
+* Fix automatic maintaining test schema to properly handle sql structure
schema format.
Fixes #15394.
@@ -455,8 +454,8 @@
*Sean Griffin*
-* Fixed error in `reset_counters` when associations have `select` scope.
- (Call to `count` generates invalid SQL.)
+* Fix an error in `reset_counters` when associations have `select` scope.
+ (Call to `count` generated invalid SQL.)
*Cade Truitt*
@@ -681,7 +680,7 @@
*Yves Senn*
-* Fixed `columns_for_distinct` of postgresql adapter to work correctly
+* Fix `columns_for_distinct` of PostgreSQL adapter to work correctly
with orders without sort direction modifiers.
*Nikolay Kondratyev*
@@ -717,7 +716,7 @@
*arthurnn*
-* Fixed serialization for records with an attribute named `format`.
+* Fix serialization for records with an attribute named `format`.
Fixes #15188.
@@ -728,12 +727,12 @@
*Kuldeep Aggarwal*
-* Fixed serialized fields returning serialized data after being updated with
+* Fix serialized fields returning serialized data after being updated with
`update_column`.
*Simon Hørup Eskildsen*
-* Fixed polymorphic eager loading when using a String as foreign key.
+* Fix polymorphic eager loading when using a String as foreign key.
Fixes #14734.
@@ -747,7 +746,7 @@
*Brock Trappitt*
-* Fixed the inferred table name of a `has_and_belongs_to_many` auxiliar
+* Fix the inferred table name of a `has_and_belongs_to_many` auxiliary
table inside a schema.
Fixes #14824.
@@ -859,7 +858,7 @@
*Yves Senn*
-* Fixed has_and_belongs_to_many's CollectionAssociation size calculation.
+* Fix `has_and_belongs_to_many` CollectionAssociation size calculations.
`has_and_belongs_to_many` should fall back to using the normal CollectionAssociation's
size calculation if the collection is not cached or loaded.
@@ -964,10 +963,12 @@
*Earl St Sauver*
-* Fixed unexpected behavior for `has_many :through` associations going through a scoped `has_many`.
+* Fix unexpected behavior for `has_many :through` associations going through
+ a scoped `has_many`.
- If a `has_many` association is adjusted using a scope, and another `has_many :through`
- uses this association, then the scope adjustment is unexpectedly neglected.
+ If a `has_many` association is adjusted using a scope, and another
+ `has_many :through` uses this association, then the scope adjustment is
+ unexpectedly neglected.
Fixes #14537.
@@ -977,13 +978,13 @@
*Kuldeep Aggarwal*
-* Fixed `has_many` association to make it support irregular inflections.
+* Enable `has_many` associations to support irregular inflections.
Fixes #8928.
*arthurnn*, *Javier Goizueta*
-* Fixed a problem where count used with a grouping was not returning a Hash.
+* Fix `count` used with a grouping not returning a Hash.
Fixes #14721.
@@ -1038,8 +1039,8 @@
*Eileen M. Uchitelle*, *Aaron Patterson*
-* Fixed error for aggregate methods (`empty?`, `any?`, `count`) with `select`
- which created invalid SQL.
+* Fix invalid SQL when aggregate methods (`empty?`, `any?`, `count`) used
+ with `select`.
Fixes #13648.
@@ -1070,8 +1071,8 @@
*Roderick van Domburg*
-* Fixed a problem where an enum would overwrite values of another enum
- with the same name in an unrelated class.
+* Fix a problem where an enum would overwrite values of another enum with the
+ same name in an unrelated class.
Fixes #14607.
@@ -1106,7 +1107,7 @@
*arthurnn*
-* Fixed error when using `with_options` with lambda.
+* Fix error when using `with_options` with lambda.
Fixes #9805.
@@ -1144,14 +1145,15 @@
*Yves Senn*
-* Fixed error when specifying a non-empty default value on a PostgreSQL array column.
+* Fix error when specifying a non-empty default value on a PostgreSQL array
+ column.
Fixes #10613.
*Luke Steensen*
-* Fixed error where .persisted? throws SystemStackError for an unsaved model with a
- custom primary key that didn't save due to validation error.
+* Fix error where `.persisted?` throws SystemStackError for an unsaved model with a
+ custom primary key that did not save due to validation error.
Fixes #14393.
@@ -1244,7 +1246,8 @@
*Aaron Patterson*
-* Only use BINARY for MySQL case sensitive uniqueness check when column has a case insensitive collation.
+* Only use BINARY for MySQL case sensitive uniqueness check when column
+ has a case insensitive collation.
*Ryuta Kamizono*
@@ -1252,8 +1255,8 @@
*arthurnn*, *Tatsuhiko Miyagawa*
-* Support for Postgres `citext` data type enabling case-insensitive where
- values without needing to wrap in UPPER/LOWER sql functions.
+* Support for PostgreSQL `citext` data type enabling case-insensitive
+ `where` values without needing to wrap in UPPER/LOWER sql functions.
*Troy Kruthoff*, *Lachlan Sylvester*
@@ -1283,9 +1286,8 @@
*Aaron Patterson*, *Yves Senn*
-* Fixed error with validation with enum fields for records where the
- value for any enum attribute is always evaluated as 0 during
- uniqueness validation.
+* Fix error with validation with enum fields for records where the value for
+ any enum attribute is always evaluated as 0 during uniqueness validation.
Fixes #14172.
@@ -1299,8 +1301,8 @@
Fixes #14144.
-* Fixed STI classes not defining an attribute method if there is a
- conflicting private method defined on its ancestors.
+* Fix STI classes not defining an attribute method if there is a conflicting
+ private method defined on its ancestors.
Fixes #11569.
diff --git a/railties/lib/rails/commands/dbconsole.rb b/railties/lib/rails/commands/dbconsole.rb
index 1a2613a8d0..b01cdce6ea 100644
--- a/railties/lib/rails/commands/dbconsole.rb
+++ b/railties/lib/rails/commands/dbconsole.rb
@@ -74,6 +74,21 @@ module Rails
find_cmd_and_exec('sqlplus', logon)
+ when "sqlserver"
+ args = []
+
+ args += ["-D", "#{config['database']}"] if config['database']
+ args += ["-U", "#{config['username']}"] if config['username']
+ args += ["-P", "#{config['password']}"] if config['password']
+
+ if config['host']
+ host_arg = "#{config['host']}"
+ host_arg << ":#{config['port']}" if config['port']
+ args += ["-S", host_arg]
+ end
+
+ find_cmd_and_exec("sqsh", *args)
+
else
abort "Unknown command-line client for #{config['database']}. Submit a Rails patch to add support!"
end