Skip to content

Commit ae95a57

Browse files
committedAug 9, 2015
add title to membership table
1 parent 4d8ea3d commit ae95a57

File tree

5 files changed

+13
-4
lines changed

5 files changed

+13
-4
lines changed
 

‎app/models/teams/member.rb

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# team_banner :string(255)
1313
# team_avatar :string(255)
1414
# role :string(255) default("member")
15+
# title :string(255)
1516
#
1617

1718
# TODO: Move team_banner to uhhh... the Team. Maybe that would make sense.

‎config/routes.rb

-2
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@
7070
# settings GET /settings(.:format) users#edit
7171
# unsubscribe GET /unsubscribe(.:format) emails#unsubscribe
7272
# delivered GET /delivered(.:format) emails#delivered
73-
# delete_account GET /delete_account(.:format) users#delete_account
74-
# delete_account_confirmed POST /delete_account_confirmed(.:format) users#delete_account_confirmed
7573
# authentications GET /authentications(.:format) authentications#index
7674
# POST /authentications(.:format) authentications#create
7775
# new_authentication GET /authentications/new(.:format) authentications#new
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class AddTitleToMembership < ActiveRecord::Migration
2+
def change
3+
add_column :teams_members, :title, :string
4+
Teams::Member.includes(:user).find_each(batch_size: 200) do |membership|
5+
membership.update_attribute(:title, membership.user.title)
6+
end
7+
end
8+
end

‎db/schema.rb

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#
1212
# It's strongly recommended to check this file into your version control system.
1313

14-
ActiveRecord::Schema.define(:version => 20150726135616) do
14+
ActiveRecord::Schema.define(:version => 20150809160133) do
1515

1616
add_extension "citext"
1717
add_extension "hstore"
@@ -266,7 +266,7 @@
266266
t.text "attended_events"
267267
t.boolean "deleted", :default => false, :null => false
268268
t.datetime "deleted_at"
269-
t.json "links", :default => "{}"
269+
t.json "links", :default => "{}"
270270
end
271271

272272
add_index "skills", ["deleted", "user_id"], :name => "index_skills_on_deleted_and_user_id"
@@ -405,6 +405,7 @@
405405
t.string "team_banner"
406406
t.string "team_avatar"
407407
t.string "role", :default => "member"
408+
t.string "title"
408409
end
409410

410411
create_table "user_events", :force => true do |t|

‎spec/models/teams/member_spec.rb

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# team_banner :string(255)
1313
# team_avatar :string(255)
1414
# role :string(255) default("member")
15+
# title :string(255)
1516
#
1617

1718
require 'rails_helper'

0 commit comments

Comments
 (0)
Please sign in to comment.