```ruby
class BookingsController < AuthorizedController
  # Actions
  def new
    @booking = Booking.new(:value_date => Date.today)
    new!
  end
  
  def select_booking
    @booking = Booking.find(params[:id]).clone
    @booking.value_date = params[:booking][:value_date]
    render :action => 'edit'
  end
  
  def select_booking_template
    @booking_template = BookingTemplate.find(params[:id]).clone
    @booking = @booking_template.build_booking(params[:booking])
    render :action => 'edit'
  end
  
  def select
    @booking = Booking.new(params[:booking])
    @booking_templates = BookingTemplate.all.paginate(:page => params[:page])
    @bookings = Booking.where("title LIKE ?", '%' + @booking.title + '%').order('value_date DESC').paginate(:page => params[:page])
  end
  
  def create
    @booking = Booking.new(params[:booking])

    create! do |success, failure|
      success.html {redirect_to new_booking_path(:notice => render_to_string(:partial => 'layouts/flash_new', :locals => {:object => @booking}))}
      failure.html {render 'edit'}
    end
  end
  
  def index
    order_by = params[:order] || 'value_date'
    @bookings = Booking.paginate :page => params[:page], :per_page => 100, :order => order_by
    index!
  end

  def copy
    @booking = Booking.find(params[:id])
    new_booking = @booking.clone
    new_booking.save
    render :partial => 'booking', :object => new_booking
  end
end
```

Drop special index handling for bookings, add by_value_period scoping.
user
```ruby
class BookingsController < AuthorizedController
  # Scopes
  has_scope :by_value_period, :using => [:from, :to], :default => proc { |c| c.session[:has_scope] }

  # Actions
  def new
    @booking = Booking.new(:value_date => Date.today)
    new!
  end
  
  def select_booking
    @booking = Booking.find(params[:id]).clone
    @booking.value_date = params[:booking][:value_date]
    render :action => 'edit'
  end
  
  def select_booking_template
    @booking_template = BookingTemplate.find(params[:id]).clone
    @booking = @booking_template.build_booking(params[:booking])
    render :action => 'edit'
  end
  
  def select
    @booking = Booking.new(params[:booking])
    @booking_templates = BookingTemplate.all.paginate(:page => params[:page])
    @bookings = Booking.where("title LIKE ?", '%' + @booking.title + '%').order('value_date DESC').paginate(:page => params[:page])
  end
  
  def create
    @booking = Booking.new(params[:booking])

    create! do |success, failure|
      success.html {redirect_to new_booking_path(:notice => render_to_string(:partial => 'layouts/flash_new', :locals => {:object => @booking}))}
      failure.html {render 'edit'}
    end
  end
  
  def copy
    @booking = Booking.find(params[:id])
    new_booking = @booking.clone
    new_booking.save
    render :partial => 'booking', :object => new_booking
  end
end
```
assistant