On Mon, Feb 6, 2012 at 13:53, Dheeraj Kumar wrote:
> You should move most conditions to validations. That IMHO is the best way to
> refactor this.
D'oh, you're right, I totally glossed over that it was in his
*controller*! Yeah, this is a canonical time when the Zen master
should whack the stud
delegating some logic in to models methods might help.
On Feb 6, 12:16 pm, regedarek wrote:
> Hi, I have in my controller action book, but it looks ugly. How to refactor
> its right way?
>
> def book
>
>
>
>
>
>
>
> > if params[:date].present? && params[:room].present? && current_user
> >
You should move most conditions to validations. That IMHO is the best way to
refactor this.
Dheeraj Kumar
On Tuesday 7 February 2012 at 12:19 AM, Dave Aronson wrote:
> On Mon, Feb 6, 2012 at 13:16, regedarek (mailto:dariusz.fins...@gmail.com)> wrote:
>
> > How to refactor its right way?
>
3 matches
Mail list logo