Skip to content

Commit 2e90819

Browse files
committed
moved version check outside of call to initializer
1 parent c72315c commit 2e90819

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/haml-rails.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,10 @@ class Railtie < ::Rails::Railtie
4545
end
4646
end
4747

48-
initializer 'haml_rails.configure_source_annotation' do
49-
# Configure source annoatation on haml files
50-
51-
# HAML support existed in Rails 3.2, 4.0, and 4.1, but was dropped in 4.2
52-
if ::Rails.version >= '4.2'
48+
# Configure source annoatation on haml files (support for HAML was
49+
# provided directly by railties 3.2..4.1 but was dropped in 4.2.
50+
if ::Rails.version.to_s >= '4.2'
51+
initializer 'haml_rails.configure_source_annotation' do
5352
SourceAnnotationExtractor::Annotation.register_extensions('haml') do |tag|
5453
/\s*-#\s*(#{tag}):?\s*(.*)/
5554
end

0 commit comments

Comments
 (0)