mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-24 08:52:14 -04:00
Added bio to member model
This commit is contained in:
@@ -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
|
||||
|
||||
5
db/migrate/20130809012511_add_bio_to_members.rb
Normal file
5
db/migrate/20130809012511_add_bio_to_members.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddBioToMembers < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :members, :bio, :text
|
||||
end
|
||||
end
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user