diff options
Diffstat (limited to 'activesupport/lib/active_support/core_ext/string/starts_ends_with.rb')
-rw-r--r-- | activesupport/lib/active_support/core_ext/string/starts_ends_with.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/string/starts_ends_with.rb b/activesupport/lib/active_support/core_ext/string/starts_ends_with.rb index 67174019db..3960669798 100644 --- a/activesupport/lib/active_support/core_ext/string/starts_ends_with.rb +++ b/activesupport/lib/active_support/core_ext/string/starts_ends_with.rb @@ -3,6 +3,13 @@ module ActiveSupport #:nodoc: module String #:nodoc: # Additional string tests. module StartsEndsWith + def self.included(base) + base.class_eval do + alias_method :start_with?, :starts_with? + alias_method :end_with?, :ends_with? + end + end + # Does the string start with the specified +prefix+? def starts_with?(prefix) prefix = prefix.to_s |