Sha256: 18becf73bc21a34823e6cdfa5acf8749f4052b0f890bd9499480dc24cbc42ba9

Contents?: true

Size: 676 Bytes

Versions: 1

Compression:

Stored size: 676 Bytes

Contents

class E9Crm::PageViewsController < E9Crm::ResourcesController
  defaults :resource_class => PageView
  belongs_to :campaign, :contact, :polymorphic => true

  # NOTE association chain is prepended to ensure parent is loaded so other
  #      before filters can use collection_path, etc.  Is there a better solution
  #      for this?
  #
  prepend_before_filter :association_chain

  has_scope :until_time, :as => :until, :unless => 'params[:from].present?'

  has_scope :from_time, :as => :from do |controller, scope, value|
    if controller.params[:until]
      scope.for_time_range(value, controller.params[:until])
    else
      scope.from_time(value)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
e9_crm-0.1.1 app/controllers/e9_crm/page_views_controller.rb