diff options
| -rw-r--r-- | activerecord/CHANGELOG.md | 4 | ||||
| -rw-r--r-- | activesupport/lib/active_support/core_ext/string/access.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 919905e884..e9a7d9f597 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,7 +1,7 @@ -* Allow matches_regex on MySQL +* Allow `matches_regex` and `does_not_match_regexp` on the MySQL Arel visitor. *James Pearson* - + * Allow specifying fixtures to be ignored by setting `ignore` in YAML file's '_fixture' section. *Tongfei Gao* diff --git a/activesupport/lib/active_support/core_ext/string/access.rb b/activesupport/lib/active_support/core_ext/string/access.rb index 1a0b10b4f6..f6a14c08bc 100644 --- a/activesupport/lib/active_support/core_ext/string/access.rb +++ b/activesupport/lib/active_support/core_ext/string/access.rb @@ -76,7 +76,7 @@ class String # str.first(0) # => "" # str.first(6) # => "hello" def first(limit = 1) - self[0, limit] || (raise ArgumentError, "negative limit") + self[0, limit] || raise(ArgumentError, "negative limit") end # Returns the last character of the string. If a limit is supplied, returns a substring @@ -90,6 +90,6 @@ class String # str.last(0) # => "" # str.last(6) # => "hello" def last(limit = 1) - self[[length - limit, 0].max, limit] || (raise ArgumentError, "negative limit") + self[[length - limit, 0].max, limit] || raise(ArgumentError, "negative limit") end end |
