forked from emmapersky/one-click-orgs
-
Notifications
You must be signed in to change notification settings - Fork 12
Code Snippets
dekstop edited this page Jan 7, 2012
·
4 revisions
Misc code snippets useful for debugging sessions, to be run in the Rails console.
o = Organisation.all.first
o.clauses.set_text('organisation_state', 'pending')
Member.all.each { |m| if m.id!=1 m.member_class = MemberClass.find_or_create_by_name('Founding Member'); m.save! }
o = Organisation.find(1); m = Member.find(1)
p = o.found_organisation_proposals.new(:title=>'abc', :proposer_member_id=>m.id)
p.start; o.proposed!
o = Organisation.find(1); p = o.proposals.first
o.members.each {|m| m.cast_vote(:for, p) }
o.members.each {|m| if !m.inducted? then m.induct!; end }