Permalink
Browse files

Enable swedish characters åäö as valid constant names

  • Loading branch information...
1 parent 5bd0cb5 commit d44ccd7c70fe90badaaa4285f6439fc82fb61bd0 @dentarg committed Aug 30, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/sequel/model/inflections.rb
View
4 lib/sequel/model/inflections.rb
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
module Sequel
# Yield the Inflections module if a block is given, and return
# the Inflections module.
@@ -29,7 +31,7 @@ module Inflections
DEMODULIZE_CONVERT_REGEXP = /^.*::/.freeze
EMPTY_STRING= ''.freeze
SLASH = '/'.freeze
- VALID_CONSTANT_NAME_REGEXP = /\A(?:::)?([A-Z]\w*(?:::[A-Z]\w*)*)\z/.freeze
+ VALID_CONSTANT_NAME_REGEXP = /\A(?:::)?([A-Z][A-ZÅÄÖa-zåäö]*(?:::[A-Z][A-ZÅÄÖa-zåäö]*)*)\z/.freeze
UNDERSCORE = '_'.freeze
UNDERSCORE_CONVERT_REGEXP1 = /([A-Z]+)([A-Z][a-z])/.freeze
UNDERSCORE_CONVERT_REGEXP2 = /([a-z\d])([A-Z])/.freeze

0 comments on commit d44ccd7

Please sign in to comment.