This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create | |
@user = User.new(user_params) | |
if @user.save && current_order.id | |
session[:user_id] = @user.id | |
current_order.update_attributes(:user_id => @user.id) # new line | |
current_order.save | |
redirect_to order_path(current_order.id), :notice => "Signed up!" | |
elsif @user.save && !current_order.id | |
session[:user_id] = @user.id | |
redirect_to menu_path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "pry" | |
class EventReporter | |
def initialize | |
@queue = [] | |
end | |
def run | |
input = '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "pry" | |
class Attendee | |
attr_accessor :first_name, :last_name, | |
:zipcode, :city, | |
:email_address, :state, | |
:street, :homephone, | |
:regdate, :row | |
def initialize(row) | |
@first_name = row[:first_name] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'csv' | |
require "pry" | |
require "./attendee" | |
class DataSet | |
attr_reader :storage, :attendees | |
def initialize(file = "event_attendees.csv") | |
@file = file | |
@storage = [] | |
end |
NewerOlder