Added bio to member model

This commit is contained in:
martyhines
2013-08-08 21:38:01 -04:00
parent db8c2e4aef
commit 0d5b2bbcce
4 changed files with 14 additions and 2 deletions

View File

@@ -39,7 +39,7 @@ class Member < ActiveRecord::Base
# Setup accessible (or protected) attributes for your model
attr_accessible :login_name, :email, :password, :password_confirmation,
:remember_me, :login, :tos_agreement, :show_email,
:location, :latitude, :longitude, :send_notification_email
:location, :latitude, :longitude, :send_notification_email, :bio
# set up geocoding
geocoded_by :location

View File

@@ -0,0 +1,5 @@
class AddBioToMembers < ActiveRecord::Migration
def change
add_column :members, :bio, :text
end
end

View File

@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20130723110702) do
ActiveRecord::Schema.define(:version => 20130809012511) do
create_table "account_types", :force => true do |t|
t.string "name", :null => false
@@ -113,6 +113,7 @@ ActiveRecord::Schema.define(:version => 20130723110702) do
t.float "latitude"
t.float "longitude"
t.boolean "send_notification_email", :default => true
t.text "bio"
end
add_index "members", ["confirmation_token"], :name => "index_users_on_confirmation_token", :unique => true

View File

@@ -24,6 +24,12 @@ describe 'member' do
@member.slug.should match(/member\d+/)
end
it 'has a bio' do
@member.bio = 'I love seeds'
@member.save
@member.bio.should eq 'I love seeds'
end
it 'should have a default garden' do
@member.save
@member.gardens.count.should == 1