aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actioncable/test/client_test.rb3
-rw-r--r--activemodel/lib/active_model/errors.rb14
-rw-r--r--activerecord/lib/active_record/connection_adapters/mysql/column.rb7
-rw-r--r--activerecord/test/cases/column_definition_test.rb7
-rw-r--r--guides/source/5_0_release_notes.md2
-rw-r--r--guides/source/getting_started.md5
6 files changed, 8 insertions, 30 deletions
diff --git a/actioncable/test/client_test.rb b/actioncable/test/client_test.rb
index f4b4a53aea..283ba9daaf 100644
--- a/actioncable/test/client_test.rb
+++ b/actioncable/test/client_test.rb
@@ -1,9 +1,6 @@
require 'test_helper'
require 'concurrent'
-require 'active_support/core_ext/hash/indifferent_access'
-require 'pathname'
-
require 'faye/websocket'
require 'json'
diff --git a/activemodel/lib/active_model/errors.rb b/activemodel/lib/active_model/errors.rb
index 9a55336902..2f883917b0 100644
--- a/activemodel/lib/active_model/errors.rb
+++ b/activemodel/lib/active_model/errors.rb
@@ -147,9 +147,9 @@ module ActiveModel
# Delete messages for +key+. Returns the deleted messages.
#
- # person.errors[:name] # => ["cannot be nil"]
+ # person.errors[:name] # => ["cannot be nil"]
# person.errors.delete(:name) # => ["cannot be nil"]
- # person.errors[:name] # => []
+ # person.errors[:name] # => []
def delete(key)
details.delete(key)
messages.delete(key)
@@ -385,18 +385,18 @@ module ActiveModel
# present, or +false+ otherwise. +message+ is treated the same as for +add+.
#
# person.errors.add :name, :blank
- # person.errors.added? :name, :blank # => true
+ # person.errors.added? :name, :blank # => true
# person.errors.added? :name, "can't be blank" # => true
#
# If the error message requires an option, then it returns +true+ with
# the correct option, or +false+ with an incorrect or missing option.
#
# person.errors.add :name, :too_long, { count: 25 }
- # person.errors.added? :name, :too_long, count: 25 # => true
- # person.errors.added? :name, :too_long, count: 24 # => false
- # person.errors.added? :name, :too_long # => false
+ # person.errors.added? :name, :too_long, count: 25 # => true
# person.errors.added? :name, "is too long (maximum is 25 characters)" # => true
- # person.errors.added? :name, "is too long" # => false
+ # person.errors.added? :name, :too_long, count: 24 # => false
+ # person.errors.added? :name, :too_long # => false
+ # person.errors.added? :name, "is too long" # => false
def added?(attribute, message = :invalid, options = {})
message = message.call if message.respond_to?(:call)
message = normalize_message(attribute, message, options)
diff --git a/activerecord/lib/active_record/connection_adapters/mysql/column.rb b/activerecord/lib/active_record/connection_adapters/mysql/column.rb
index 9c45fdd44a..ea554b188c 100644
--- a/activerecord/lib/active_record/connection_adapters/mysql/column.rb
+++ b/activerecord/lib/active_record/connection_adapters/mysql/column.rb
@@ -6,7 +6,6 @@ module ActiveRecord
def initialize(*)
super
- assert_valid_default
extract_default
end
@@ -38,12 +37,6 @@ module ActiveRecord
@default = null || strict ? nil : ''
end
end
-
- def assert_valid_default
- if blob_or_text_column? && default.present?
- raise ArgumentError, "#{type} columns cannot have a default value: #{default.inspect}"
- end
- end
end
end
end
diff --git a/activerecord/test/cases/column_definition_test.rb b/activerecord/test/cases/column_definition_test.rb
index 81162b7e98..78c0853992 100644
--- a/activerecord/test/cases/column_definition_test.rb
+++ b/activerecord/test/cases/column_definition_test.rb
@@ -60,15 +60,8 @@ module ActiveRecord
end
def test_should_not_set_default_for_blob_and_text_data_types
- assert_raise ArgumentError do
- MySQL::Column.new("title", "a", SqlTypeMetadata.new(sql_type: "blob"))
- end
-
text_type = MySQL::TypeMetadata.new(
SqlTypeMetadata.new(type: :text))
- assert_raise ArgumentError do
- MySQL::Column.new("title", "Hello", text_type)
- end
text_column = MySQL::Column.new("title", nil, text_type)
assert_equal nil, text_column.default
diff --git a/guides/source/5_0_release_notes.md b/guides/source/5_0_release_notes.md
index 8bd2074e82..5639438b93 100644
--- a/guides/source/5_0_release_notes.md
+++ b/guides/source/5_0_release_notes.md
@@ -49,7 +49,7 @@ client-side JavaScript framework and a server-side Ruby framework. You have
access to your full domain model written with Active Record or your ORM of
choice.
-See the [Active Cable Overview](action_cable_overview.html) guide for more
+See the [Action Cable Overview](action_cable_overview.html) guide for more
information.
### Rails API
diff --git a/guides/source/getting_started.md b/guides/source/getting_started.md
index 65fdd7ca0d..e0832a32a6 100644
--- a/guides/source/getting_started.md
+++ b/guides/source/getting_started.md
@@ -299,9 +299,6 @@ Rails.application.routes.draw do
get 'welcome/index'
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
-
- # Serve websocket cable requests in-process
- # mount ActionCable.server => '/cable'
end
```
@@ -318,8 +315,6 @@ Rails.application.routes.draw do
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
- # Serve websocket cable requests in-process
- # mount ActionCable.server => '/cable'
root 'welcome#index'
end
```