Permalink
Browse files

Variants can be declared without a block to signify their presence in…

… the controller
  • Loading branch information...
1 parent a16fa9a commit 99975e742eb2636cd814f2c9de21f4bd3c3dbbc7 @dhh dhh committed Dec 8, 2013
@@ -466,7 +466,9 @@ def initialize(variant)
end
def method_missing(name)
- yield if name == @variant || (name == :none && @variant.nil?)
+ if block_given?
+ yield if name == @variant || (name == :none && @variant.nil?)
+ end
end
end
end
@@ -170,7 +170,7 @@ def variant_plus_none_for_format
respond_to do |format|
format.html do |variant|
variant.phone { render text: "phone" }
- variant.none { render text: "none" }
+ variant.none
end
end
end

0 comments on commit 99975e7

Please sign in to comment.