Skip to content

Commit

Permalink
remove failed merges
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim committed Aug 1, 2013
1 parent 657f7e8 commit 4a40b00
Show file tree
Hide file tree
Showing 45 changed files with 1 addition and 1,408 deletions.
7 changes: 0 additions & 7 deletions app/controllers/admin_controller.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
class AdminController < ApplicationController
<<<<<<< HEAD

def index
@ads = Ad.all

=======
def index
@ads = Ad.all


>>>>>>> d4a4f1bcc942c20df1b86ac333158c9e7d25fbed
# for categories
@cats = Cat.find(:all, :order => "position")
@cat = Cat.new
Expand Down
36 changes: 0 additions & 36 deletions app/controllers/ads_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,7 @@ def new
@ad = Ad.new
@cats = Cat.find(:all, :conditions => ["admin is null OR admin = ?", false])
else
<<<<<<< HEAD
redirect_to login_path, notice: "Sign in to create an ad. Don't have an account? Click Sign Up to create one."
=======
session[:return_to] = "new_ad"
redirect_to(login_path)
flash[:notice] = "Sign in to create an ad. Don't have an account? Click Sign Up to create one."
>>>>>>> d4a4f1bcc942c20df1b86ac333158c9e7d25fbed
end
end

Expand All @@ -40,7 +34,6 @@ def change_sub_cats_select

respond_to do |wants|
wants.json { render :json => @subcats }
<<<<<<< HEAD
end
end

Expand All @@ -50,23 +43,6 @@ def create
redirect_to user_path(current_user)
else
render :new
=======
end


end

def create
@ad = current_user.ads.build(params[:ad])
@ad.city = current_user.city
@ad.state = current_user.state
@ad.views = 0
if @ad.save
redirect_to(new_user_ad_asset_path(current_user, @ad))
else
flash[:error] = "Something happened and your ad was not saved. Please try again."
redirect_to(username_path(current_user))
>>>>>>> d4a4f1bcc942c20df1b86ac333158c9e7d25fbed
end
end

Expand All @@ -77,10 +53,6 @@ def edit
@asset = Asset.new
end

<<<<<<< HEAD
=======

>>>>>>> d4a4f1bcc942c20df1b86ac333158c9e7d25fbed
def update
@ad = Ad.find(params[:id])
if @ad.update_attributes(params[:ad])
Expand All @@ -102,13 +74,5 @@ def views
@ad = Ad.find(params[:id])
@ad.increment!(:views)
end
<<<<<<< HEAD

=======





>>>>>>> d4a4f1bcc942c20df1b86ac333158c9e7d25fbed
end
19 changes: 0 additions & 19 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,22 +1,3 @@
<<<<<<< HEAD
class ApplicationController < ActionController::Base
protect_from_forgery
=======
# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.

class ApplicationController < ActionController::Base
helper :all # include all helpers, all the time
protect_from_forgery # See ActionController::RequestForgeryProtection for details

include AuthenticatedSystem

# Scrub sensitive parameters from your log
# filter_parameter_logging :password

def get_ad_id
@ad = Ad.find(params[:ad_id])
end

>>>>>>> d4a4f1bcc942c20df1b86ac333158c9e7d25fbed
end
8 changes: 1 addition & 7 deletions app/controllers/cats_controller.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
class CatsController < ApplicationController
<<<<<<< HEAD

=======
>>>>>>> d4a4f1bcc942c20df1b86ac333158c9e7d25fbed

def index
@cats = Cat.all
end
Expand Down Expand Up @@ -37,8 +34,5 @@ def destroy
flash[:notice] = "Successfully destroyed cat."
redirect_to(admin_path)
end
<<<<<<< HEAD

=======
>>>>>>> d4a4f1bcc942c20df1b86ac333158c9e7d25fbed
end
53 changes: 0 additions & 53 deletions app/controllers/sessions_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<<<<<<< HEAD
class SessionsController < ApplicationController

def create
Expand All @@ -8,64 +7,12 @@ def create
else
flash[:error] = 'The Email or Password you entered is incorrect'
redirect_to signin_path
=======
# This controller handles the login/logout function of the site.
class SessionsController < ApplicationController
# Be sure to include AuthenticationSystem in Application Controller instead
include AuthenticatedSystem

# render new.erb.html
def new
end

def create
logout_keeping_session!
user = User.authenticate(params[:login], params[:password])
if user
# Protects against session fixation attacks, causes request forgery
# protection if user resubmits an earlier form using back
# button. Uncomment if you understand the tradeoffs.
# reset_session
self.current_user = user
new_cookie_flag = (params[:remember_me] == "1")
handle_remember_cookie! new_cookie_flag

flash[:notice] = "Logged in successfully"
if session[:return_to] == "new_ad"
redirect_to(new_user_ad_path(current_user))
elsif session[:return_to] == "my_ads"
redirect_to(username_path(current_user))
else
redirect_to(root_path)
end
session[:return_to] = nil

else
note_failed_signin
@login = params[:login]
@remember_me = params[:remember_me]
render :action => 'new'
>>>>>>> d4a4f1bcc942c20df1b86ac333158c9e7d25fbed
end
end

def destroy
<<<<<<< HEAD
logout
redirect_to root_path, notice: 'Logged Out'
end

=======
logout_killing_session!
flash[:notice] = "You have been logged out."
redirect_back_or_default('/')
end

protected
# Track failed login attempts
def note_failed_signin
flash[:error] = "Couldn't log you in as '#{params[:login]}'"
logger.warn "Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.now.utc}"
end
>>>>>>> d4a4f1bcc942c20df1b86ac333158c9e7d25fbed
end
12 changes: 0 additions & 12 deletions app/controllers/sub_cats_controller.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
class SubCatsController < ApplicationController

<<<<<<< HEAD
=======

>>>>>>> d4a4f1bcc942c20df1b86ac333158c9e7d25fbed
def new
@sub_cat = SubCat.new
end
Expand All @@ -13,10 +9,6 @@ def create
@sub_cat = @cat.sub_cats.build(params[:sub_cat])
if @sub_cat.save
redirect_to(admin_path)
<<<<<<< HEAD
=======
else
>>>>>>> d4a4f1bcc942c20df1b86ac333158c9e7d25fbed
end
end

Expand All @@ -27,11 +19,7 @@ def prioritize_sub_cats
sub_cat.position = params["sub_cat"].index(sub_cat.id.to_s)
sub_cat.save
end
<<<<<<< HEAD
render :nothing
=======
render :nothing => true
>>>>>>> d4a4f1bcc942c20df1b86ac333158c9e7d25fbed
end

def update
Expand Down
31 changes: 0 additions & 31 deletions app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
class UsersController < ApplicationController

<<<<<<< HEAD
=======


# render new.rhtml
>>>>>>> d4a4f1bcc942c20df1b86ac333158c9e7d25fbed
def new
@user = User.new
end

def create
<<<<<<< HEAD
@user = User.new(params[:user])
if @user.save
auto_login(@user)
Expand All @@ -21,22 +14,6 @@ def create
end
end

=======
logout_keeping_session!
@user = User.new(params[:user])
success = @user && @user.save
if success && @user.errors.empty?
self.current_user = @user # !! now logged in
redirect_to(root_path)
flash[:notice] = "Thanks for signing up!"
else
flash[:error] = "We couldn't set up that account, sorry. Please try again."
render :action => 'new'
end
end


>>>>>>> d4a4f1bcc942c20df1b86ac333158c9e7d25fbed
def update
if current_user.update_attributes(params[:user])
current_user.ads.each do |ad|
Expand All @@ -60,13 +37,5 @@ def show
flash[:notice] = "You must sign in before you can see your ads. Don't have an account? Click Sign Up to create one."
end
end
<<<<<<< HEAD

=======





>>>>>>> d4a4f1bcc942c20df1b86ac333158c9e7d25fbed
end
17 changes: 0 additions & 17 deletions app/models/ad.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
class Ad < ActiveRecord::Base
<<<<<<< HEAD
attr_accessible :title, :description, :city, :state, :views, :sub_cat

belongs_to :user
Expand All @@ -12,25 +11,9 @@ class Ad < ActiveRecord::Base
def self.search(search)
if search
where('sub_category LIKE ?', search)
=======
belongs_to :user
has_many :assets

validates_presence_of :sub_category


#this is to search
def self.search(search)
if search
find(:all, :conditions => ['sub_category LIKE ?', "%#{search}%"])
>>>>>>> d4a4f1bcc942c20df1b86ac333158c9e7d25fbed
else
find(:all)
end
end

<<<<<<< HEAD
=======

>>>>>>> d4a4f1bcc942c20df1b86ac333158c9e7d25fbed
end
4 changes: 0 additions & 4 deletions app/models/asset.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
class Asset < ActiveRecord::Base
belongs_to :ad
<<<<<<< HEAD

has_attached_file :image
=======
mount_uploader :image, ImageUploader
>>>>>>> d4a4f1bcc942c20df1b86ac333158c9e7d25fbed
end
6 changes: 0 additions & 6 deletions app/models/cat.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
class Cat < ActiveRecord::Base
<<<<<<< HEAD
attr_accessible :name, :admin, :position

has_many :sub_cats
=======
has_many :sub_cats

attr_accessible :name, :admin, :position
>>>>>>> d4a4f1bcc942c20df1b86ac333158c9e7d25fbed
end
Loading

0 comments on commit 4a40b00

Please sign in to comment.