Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class User < ActiveRecord::Base
PERMITTED_ATTRIBUTES = [:first_name, :last_name, :email, :password, :password_confirmation, :remember_me, :time_zone, :gender, :allow_event_email]
PERMITTED_ATTRIBUTES = [:first_name, :last_name, :email, :password, :password_confirmation, :remember_me, :time_zone, :gender, :allow_event_email, :allow_chapter_email]

before_validation :build_profile, on: :create

Expand Down
3 changes: 3 additions & 0 deletions app/views/devise/registrations/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
<%= f.label :allow_event_email do %>
<%= f.check_box :allow_event_email %> Allow Bridge Troll to send you an email when a new event is posted in one of those regions
<% end %>
<%= f.label :allow_chapter_email do %>
<%= f.check_box :allow_chapter_email %> Allow Bridge Troll to send you chapter announcement emails
<% end %>
</div>

<div class='form-group'>
Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20160410220055_add_chapter_email_to_user.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddChapterEmailToUser < ActiveRecord::Migration
def change
add_column :users, :allow_chapter_email, :boolean, default: true
end
end
3 changes: 2 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20160312224628) do
ActiveRecord::Schema.define(version: 20160410220055) do

create_table "authentications", force: :cascade do |t|
t.integer "user_id"
Expand Down Expand Up @@ -294,6 +294,7 @@
t.boolean "publisher", default: false
t.boolean "spammer", default: false
t.integer "authentications_count", default: 0
t.boolean "allow_chapter_email", default: true
end

add_index "users", ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true
Expand Down