Sha256: eff35fbf2866f849ac73d6210e5826f5af32287be657b51543178e242b6532f6

Contents?: true

Size: 493 Bytes

Versions: 8

Compression:

Stored size: 493 Bytes

Contents

class Admin::StatsController < ApplicationController
  before_filter :authenticate_admin_user!

  def stats
    if params[:scope].blank?
      render :json => { :errors => "scope not set" }, :status => 422
    else
      cls = User
      cls = Identity.where( "provider = ?", "twitter" ) if params[:scope] == 'twitter_users'
      cls = Identity.where( "provider = ?", "instagram" ) if params[:scope] == 'instagram_users'
      ret = cls.group_by_month
      render json: ret
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
happy_seed-0.0.19 lib/generators/happy_seed/admin/templates/app/controllers/admin/stats_controller.rb
happy_seed-0.0.18 lib/generators/happy_seed/admin/templates/app/controllers/admin/stats_controller.rb
happy_seed-0.0.17 lib/generators/happy_seed/admin/templates/app/controllers/admin/stats_controller.rb
happy_seed-0.0.16 lib/generators/happy_seed/admin/templates/app/controllers/admin/stats_controller.rb
happy_seed-0.0.15 lib/generators/happy_seed/admin/templates/app/controllers/admin/stats_controller.rb
happy_seed-0.0.14 lib/generators/happy_seed/admin/templates/app/controllers/admin/stats_controller.rb
happy_seed-0.0.13 lib/generators/happy_seed/admin/templates/app/controllers/admin/stats_controller.rb
happy_seed-0.0.12 lib/generators/happy_seed/admin/templates/app/controllers/admin/stats_controller.rb