Skip to content
This repository has been archived by the owner on May 18, 2021. It is now read-only.

Commit

Permalink
fix merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
haukot committed Feb 11, 2014
1 parent 1cd3f4a commit 2aa9f0a
Show file tree
Hide file tree
Showing 10 changed files with 1 addition and 91 deletions.
4 changes: 1 addition & 3 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
class ApplicationController < ActionController::Base
include AuthHelper
include Mobylette::RespondToMobileRequests
Expand All @@ -6,10 +7,7 @@ class ApplicationController < ActionController::Base

before_filter :deny_banned_user!

<<<<<<< HEAD
# FIXME запхать это в конфигас как-нить
=======
>>>>>>> 940c36cc6eab2279d083dac39d5d976c4827fac5
if Rails.env.production? or Rails.env.staging?
rescue_from ActionController::RoutingError, ActionView::MissingTemplate, ActiveRecord::RecordNotFound do |exception|
redirect_to "/404"
Expand Down
20 changes: 0 additions & 20 deletions app/controllers/web/account/ticket_orders_controller.rb
Original file line number Diff line number Diff line change
@@ -1,34 +1,14 @@
class Web::Account::TicketOrdersController < Web::Account::ApplicationController
skip_before_filter :authenticate_user!, only: [:new]

<<<<<<< HEAD
def create
@ticket_order = current_user.ticket_orders.build params[:ticket_order]
gon.price = configus.platidoma.ticket_price
if @ticket_order.save
=======
def new
@ticket_order = TicketOrder.new
end

def create
@ticket_order = current_user.ticket_orders.build params[:ticket_order]
if @ticket_order.day.full?
gon.price = configus.platidoma.full_ticket_price
else
gon.price = configus.platidoma.ticket_price
end
if @ticket_order.save
@ticket_order.user.pay_part
>>>>>>> 940c36cc6eab2279d083dac39d5d976c4827fac5
redirect_to build_payment_curl @ticket_order
else
flash_error
render :new
end
end
<<<<<<< HEAD

=======
>>>>>>> 940c36cc6eab2279d083dac39d5d976c4827fac5
end
16 changes: 0 additions & 16 deletions app/helpers/web/account/ticket_orders_helper.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,2 @@
module Web::Account::TicketOrdersHelper
<<<<<<< HEAD
=======
def bought_day?(day)
if current_user.ticket_orders.any?
current_user.ticket_orders.first.day == day
end
end

def bought_first_day?
bought_day? :first
end

def bought_second_day?
bought_day? :second
end
>>>>>>> 940c36cc6eab2279d083dac39d5d976c4827fac5
end
11 changes: 0 additions & 11 deletions app/models/ticket_order.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
class TicketOrder < Order
extend Enumerize

<<<<<<< HEAD
attr_accessible :ticket_type, :order_option_id
belongs_to :order_option

Expand All @@ -17,15 +16,5 @@ def cost
elsif self.ticket_type.full?
configus.platidoma.ticket_price_first_day + configus.platidoma.ticket_price_second_day
end
=======
attr_accessible :day

enumerize :day, in: [:first, :second, :full], default: :full

validates :day, presence: true

def cost
self.items_count * configus.platidoma.ticket_price
>>>>>>> 940c36cc6eab2279d083dac39d5d976c4827fac5
end
end
5 changes: 0 additions & 5 deletions config/configus.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
login credentials_hash["production"]["platidoma"]["login"]
gate_password credentials_hash["production"]["platidoma"]["gate_password"]
shirt_price 500
<<<<<<< HEAD
if Time.current.month == 2
ticket_price_first_day 500
ticket_price_second_day 250
Expand All @@ -64,10 +63,6 @@
ticket_price_first_day 1000
ticket_price_second_day 500
end
=======
ticket_price 500
full_ticket_price 1000
>>>>>>> 940c36cc6eab2279d083dac39d5d976c4827fac5
end

cache do
Expand Down
4 changes: 0 additions & 4 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,8 @@
end
end
resources :shirt_orders, only: [:new, :create]
<<<<<<< HEAD
resources :ticket_orders, only: :create
resources :order_options, only: :create
=======
resources :ticket_orders, only: [:new, :create]
>>>>>>> 940c36cc6eab2279d083dac39d5d976c4827fac5
resources :promo_codes, only: [] do
member do
put :accept
Expand Down
9 changes: 0 additions & 9 deletions db/migrate/20140207021244_create_ticket_orders.rb

This file was deleted.

10 changes: 0 additions & 10 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.

<<<<<<< HEAD
ActiveRecord::Schema.define(:version => 20140211041744) do
=======
ActiveRecord::Schema.define(:version => 20140207021244) do
>>>>>>> 940c36cc6eab2279d083dac39d5d976c4827fac5

create_table "audits", :force => true do |t|
t.integer "auditable_id"
Expand Down Expand Up @@ -168,12 +164,6 @@
t.string "event_type"
end

create_table "ticket_orders", :force => true do |t|
t.string "day"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end

create_table "topics", :force => true do |t|
t.string "title"
t.text "description"
Expand Down
5 changes: 0 additions & 5 deletions test/factories/ticket_orders.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
FactoryGirl.define do
factory :ticket_order do
<<<<<<< HEAD
items_count
ticket_type "full"
user
=======
user
items_count
>>>>>>> 940c36cc6eab2279d083dac39d5d976c4827fac5
end
end
8 changes: 0 additions & 8 deletions test/functional/web/account/ticket_orders_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@ class Web::Account::TicketOrdersControllerTest < ActionController::TestCase
@order = create :ticket_order
end

<<<<<<< HEAD
=======
test "should get new" do
get :new
assert_response :success
end

>>>>>>> 940c36cc6eab2279d083dac39d5d976c4827fac5
test "should post create" do
attributes = attributes_for :ticket_order
post :create, ticket_order: attributes
Expand Down

0 comments on commit 2aa9f0a

Please sign in to comment.