class ClaimController < ApplicationController

  skip_before_filter :require_authorization

  def index
    if Mockr.unclaimed? && viewer.authenticated?
      owner = User.create(:facebook_uid => viewer.facebook_uid, :name => cookies["fbname"])
      flash[:notice] = "Congratulations #{owner.first_name}, you're now the proud owner of this brand new instance of Mockr!"
      redirect_to root_path
    else
      redirect_to new_session_path
    end
  end
end

class ClaimController < ApplicationController

  skip_before_filter :require_authorization

  def index
    if Mockr.unclaimed? && viewer.authenticated?
      owner = User.create(:facebook_uid => viewer.facebook_uid,
        :name => "Jacob")
      flash[:notice] = "Congratulations #{owner.first_name}, you're now the proud owner of this brand new instance of Mockr!"
      redirect_to root_path
    else
      redirect_to new_session_path
    end
  end
end

Standardize on a default name that doesn't depend on a Facebook cookie.
Standardize on a default name that doesn't depend on a Facebook cookie.

Change-Id: Ie20a5957809fbf8ed56cf943e2fa1959634a2e9b
Reviewed-on: https://gerrit.causes.com/5045
Reviewed-by: Chris Chan <711c73f64afdce07b7e38039a96d2224209e9a6c@causes.com>
Tested-by: Chris Chan <711c73f64afdce07b7e38039a96d2224209e9a6c@causes.com>
