[Haml] Don't clobber dynamic_form in Rails 3 beta.

This is actually covering up a bug in dynamic_form,
which should hopefully get fixed soon.

Closes gh-134
This commit is contained in:
Nathan Weizenbaum 2010-04-21 21:05:32 -07:00
parent 6ec791ebb7
commit 1e0345f9ab
5 changed files with 17 additions and 16 deletions

View File

@ -3,13 +3,14 @@
* Table of contents
{:toc}
## 2.2.24
## 2.2.24 (Unreleased)
[Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.24).
* Don't prevent ActiveModel form elements from having error formatting applied.
* Make sure `form_for` blocks are properly indented under Rails 3.0.0.beta.3.
* Don't prevent ActiveModel form elements from having error formatting applied.
* Don't activate a bug in the `dynamic_form` plugin under Rails 3.0.0.beta.3
that would cause its methods not to be loaded.
## 2.2.23

View File

@ -1,8 +1,3 @@
if defined?(ActionView)
require 'haml/helpers/action_view_mods'
require 'haml/helpers/action_view_extensions'
end
module Haml
# This module contains various helpful methods to make it easier to do various tasks.
# {Haml::Helpers} is automatically included in the context
@ -52,8 +47,7 @@ MESSAGE
self.extend self
@@action_view_defined = defined?(ActionView)
@@force_no_action_view = false
@@action_view_defined = false
# @return [Boolean] Whether or not ActionView is loaded
def self.action_view?
@ -572,8 +566,6 @@ END
_erbout = _hamlout.buffer
proc { |*args| proc.call(*args) }
end
include ActionViewExtensions if self.const_defined? "ActionViewExtensions"
end
end

View File

@ -1,7 +1,7 @@
require 'haml/helpers/action_view_mods'
module Haml
module Helpers
@@action_view_defined = true
# This module contains various useful helper methods
# that either tie into ActionView or the rest of the ActionPack stack,
# or are only useful in that context.
@ -51,5 +51,7 @@ module Haml
@_haml_concat_raw = old
end
end
include ActionViewExtensions
end
end

View File

@ -3,10 +3,14 @@
# Yehuda promises there will be soon,
# and once there is we should switch to that.
if defined?(Rails::Railtie)
if defined?(ActiveSupport) && Haml::Util.has?(:public_method, ActiveSupport, :on_load)
# Rails 3.0.0.beta.2+
ActiveSupport.on_load(:action_view) {Haml.init_rails(binding)}
elsif defined?(Rails::Railtie)
# Rails 3.0.0.beta1
module Haml
class Railtie < Rails::Railtie
initializer :haml do
ActiveSupport.on_load(:action_view) do
Haml.init_rails(binding)
end
end

View File

@ -1,4 +1,6 @@
require 'haml/engine'
require 'haml/helpers/action_view_mods'
require 'haml/helpers/action_view_extensions'
module Haml
# The class that keeps track of the global options for Haml within Rails.