Skip to content

Commit

Permalink
Update seed data script to add extra attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
spllr committed Jul 22, 2011
1 parent b028e96 commit 961eb8d
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions script/seed_members.rb
Expand Up @@ -4,6 +4,29 @@
users = list['users']
users.each do |attributes|
member = Member.find_by_twitter_id(attributes['id'].to_s) || Member.create_with_twitter_user_attributes(attributes)

# TODO Check for better way of setting properties in seed
member.entity << case list_name
when "companies" then "company"
when "students" then "student"
when "collectives" then "group"
else
"individual"
end

member.work_location = "appsterdam" if list_name == "appsterdammers"


member.work_types = member.work_types.push

member.work_types = member.work_types << case list_name
when "designers" then "design"
when "developers" then "developer"
when "marketeers" then "marketing"
else
nil
end

member.save
end
end
Expand Down

0 comments on commit 961eb8d

Please sign in to comment.