Patch #14766

Better block detection on my page

Added by Daniel Felix about 9 years ago. Updated over 8 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:


Category:Code cleanup/refactoring
Target version:2.5.0


Hi there,

I'm not sure if this is really better, but in my eyes this looks a little bit better.

I checked this line: source:/trunk/app/controllers/my_controller.rb#L142

unless %w(top left right).detect {|f| (@blocks[f] ||= []).include?(k)}
    @block_options << [l("my.blocks.#{v}", :default => [v, v.to_s.humanize]), k.dasherize]

unless{ |key, value| value}.flatten.include?(k)
    @block_options << [l("my.blocks.#{v}", :default => [v, v.to_s.humanize]), k.dasherize]

This type don't need a list of defined areas (left,right,top) and could handle even more areas.

Best regards,

Associated revisions

Revision 12658
Added by Jean-Philippe Lang over 8 years ago

Code cleanup (#14766).

Patch by Daniel Felix.


#1 Updated by Daniel Felix about 9 years ago

  • Category set to My page
  • Assignee set to Toshi MARUYAMA

Hi Toshi,

maybe you have some time to take a look at this?

Best regards,

#2 Updated by Jean-Philippe Lang over 8 years ago

  • Category changed from My page to Code cleanup/refactoring
  • Status changed from New to Closed
  • Assignee changed from Toshi MARUYAMA to Jean-Philippe Lang
  • Target version set to 2.5.0

Patch committed in r12658, thanks. FYI I've replaced .map{ |key, value| value} with a simple .values.

Also available in: Atom PDF