Commit f6d56ce35e31286158c0c751a069800832d214dc
1 parent
ea760cb1
Exists in
master
and in
28 other branches
ActionItem41: moving to_slug logic outside of lib/acts_as_filesystem.rb
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1271 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
5 changed files
with
12 additions
and
5 deletions
Show diff stats
config/environment.rb
... | ... | @@ -75,8 +75,8 @@ Localist.callback = lambda { |l| GetText.locale= l } |
75 | 75 | |
76 | 76 | Tag.hierarchical = true |
77 | 77 | |
78 | -# string transliteration | |
79 | -require 'noosfero/transliterations' | |
78 | +# several local libraries | |
79 | +require 'noosfero' | |
80 | 80 | |
81 | 81 | require 'acts_as_filesystem' |
82 | 82 | require 'acts_as_searchable' | ... | ... |
lib/acts_as_filesystem.rb
... | ... | @@ -104,9 +104,7 @@ module ActsAsFileSystem |
104 | 104 | |
105 | 105 | self[:name] = value |
106 | 106 | unless self.name.blank? |
107 | - # FIXME encapsulate this pattern (transliterate -> downcase -> gsub | |
108 | - # ...) in a String method, say, to_slug | |
109 | - self.slug = self.name.transliterate.downcase.gsub( /[^-a-z0-9~\s\.:;+=_]/, '').gsub(/[\s:;=_+]+/, '-').gsub(/[\-]{2,}/, '-').to_s | |
107 | + self.slug = self.name.to_slug | |
110 | 108 | end |
111 | 109 | end |
112 | 110 | ... | ... |
lib/noosfero.rb
... | ... | @@ -0,0 +1 @@ |
1 | +require 'noosfero/core_ext/string' | ... | ... |