Editable registrations

This commit is contained in:
Godwin
2016-08-24 22:52:10 -07:00
parent 32474fae1c
commit fe9dd2b493
9 changed files with 419 additions and 157 deletions
+8
View File
@@ -13,6 +13,10 @@ class ConferenceRegistration < ActiveRecord::Base
[:none, :tent, :house]
end
def self.all_spaces
[:bed_space, :floor_space, :tent_space]
end
def self.all_bike_options
[:yes, :no]
end
@@ -20,4 +24,8 @@ class ConferenceRegistration < ActiveRecord::Base
def self.all_food_options
[:meat, :vegetarian, :vegan]
end
def self.all_considerations
[:vegan, :smoking, :pets, :quiet]
end
end
+1 -4
View File
@@ -13,7 +13,7 @@ class User < ActiveRecord::Base
accepts_nested_attributes_for :authentications
before_save do |user|
user.locale = I18n.locale
user.locale ||= I18n.locale
end
def can_translate?(to_locale = nil, from_locale = nil)
@@ -48,9 +48,6 @@ class User < ActiveRecord::Base
user = where(email: email).first
unless user
# not really a good UX so we should fix this later
#do_404
#return
user = new(email: email)
user.save!
end