diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-06-06 04:13:23 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-06-06 04:13:23 -0700 |
commit | fec0f0678bef93f98cf1204bb007d109bbe97c37 (patch) | |
tree | 08fb8a5fa8070c1ceac5f40974eb659a21e0a274 | |
parent | 49c4c7b997c9e55907c78723c73f537087b1497d (diff) | |
parent | e2c49e6a59f1b969a526586a3dd4dfd9c6f12b10 (diff) | |
download | rails-fec0f0678bef93f98cf1204bb007d109bbe97c37.tar.gz rails-fec0f0678bef93f98cf1204bb007d109bbe97c37.tar.bz2 rails-fec0f0678bef93f98cf1204bb007d109bbe97c37.zip |
Merge branch 'master' into erbout
-rw-r--r-- | actionpack/lib/action_view/helpers/tag_helper.rb | 7 | ||||
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 11 |
2 files changed, 12 insertions, 6 deletions
diff --git a/actionpack/lib/action_view/helpers/tag_helper.rb b/actionpack/lib/action_view/helpers/tag_helper.rb index e669620381..a8a5987b1f 100644 --- a/actionpack/lib/action_view/helpers/tag_helper.rb +++ b/actionpack/lib/action_view/helpers/tag_helper.rb @@ -1,5 +1,6 @@ require 'cgi' require 'erb' +require 'set' module ActionView module Helpers #:nodoc: @@ -8,7 +9,8 @@ module ActionView module TagHelper include ERB::Util - BOOLEAN_ATTRIBUTES = Set.new(%w(disabled readonly multiple)) + BOOLEAN_ATTRIBUTES = %w(disabled readonly multiple).to_set + BOOLEAN_ATTRIBUTES.merge(BOOLEAN_ATTRIBUTES.map(&:to_sym)) # Returns an empty HTML tag of type +name+ which by default is XHTML # compliant. Set +open+ to true to create an open tag compatible @@ -37,7 +39,7 @@ module ActionView # tag("img", { :src => "open & shut.png" }, false, false) # # => <img src="open & shut.png" /> def tag(name, options = nil, open = false, escape = true) - "<#{name}#{tag_options(options, escape) if options}" + (open ? ">" : " />") + "<#{name}#{tag_options(options, escape) if options}#{open ? ">" : " />"}" end # Returns an HTML block tag of type +name+ surrounding the +content+. Add @@ -111,7 +113,6 @@ module ActionView if escape options.each do |key, value| next unless value - key = key.to_s value = BOOLEAN_ATTRIBUTES.include?(key) ? key : escape_once(value) attrs << %(#{key}="#{value}") end diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 8dd07eb478..110902b590 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -2064,13 +2064,18 @@ module ActiveRecord #:nodoc: end def expand_range_bind_variables(bind_vars) #:nodoc: - bind_vars.sum do |var| + expanded = [] + + bind_vars.each do |var| if var.is_a?(Range) - [var.first, var.last] + expanded << var.first + expanded << var.last else - [var] + expanded << var end end + + expanded end def quote_bound_value(value) #:nodoc: |