Skip to content

Commit

Permalink
card migrations for wagn 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
leword committed Oct 19, 2009
1 parent df0ad4d commit 9abcc14
Show file tree
Hide file tree
Showing 11 changed files with 202 additions and 1 deletion.
32 changes: 32 additions & 0 deletions db/migrate/20091019222942_set_star_account_plus_star_rform.rb
@@ -0,0 +1,32 @@
class SetStarAccountPlusStarRform < ActiveRecord::Migration
def self.up
User.as(:wagbot) do
card = Card.find_or_create :name=>"*account+*rform", :type=>"Basic"
if card.revisions.map(&:author).map(&:login).uniq == ["wagbot"]
card.content <<CONTENT
<h1>{{_left|name}}'s roles<br></h1>
<blockquote>
<p>{{_left+*roles|item:link}}</p>
</blockquote>
<p>&nbsp;</p>
<h1>Cards {{_left|name}} is watching</h1>
<blockquote>
<p>You'll receive email whenever these cards (or cards of types listed here) are changed. [[http://wagn.org/wagn/Notification|Learn more about notifications]].</p>
<p>{{_left+*watching|item:change}}</p>
</blockquote>
<p>&nbsp;</p>
<h1>Cards {{_left|name}} has edited</h1>
<blockquote>
<p>{{_left +*editing}}</p>
</blockquote>
CONTENT
card.permit('edit',Role[:admin])
card.permit('delete',Role[:admin])
card.save!
end
end
end

def self.down
end
end
25 changes: 25 additions & 0 deletions db/migrate/20091019222946_set_star_watching_plus_star_rform.rb
@@ -0,0 +1,25 @@
class SetStarWatchingPlusStarRform < ActiveRecord::Migration
def self.up
User.as(:wagbot) do
card = Card.find_or_create :name=>"*watching+*rform", :type=>"Search"
if card.revisions.map(&:author).map(&:login).uniq == ["wagbot"]
card.content <<CONTENT
/* fixit - once "type" accepts card defs:
{"or":
{"and": {"plus": ["*watcher", {"refer_to": "_self"} ], "not": {"type": "Cardtype"} } },
{"type": {"plus": ["*watcher", {"refer_to": "_self"} ], "type": "Cardtype"} }
}
*/
{"plus": ["*watcher", {"refer_to": "_self"} ] }
CONTENT
card.permit('edit',Role[:admin])
card.permit('delete',Role[:admin])
card.save!
end
end
end

def self.down
end
end
18 changes: 18 additions & 0 deletions db/migrate/20091019222949_set_star_thank_plus_star_rform.rb
@@ -0,0 +1,18 @@
class SetStarThankPlusStarRform < ActiveRecord::Migration
def self.up
User.as(:wagbot) do
card = Card.find_or_create :name=>"*thanks+*rform", :type=>"Phrase"
if card.revisions.map(&:author).map(&:login).uniq == ["wagbot"]
card.content <<CONTENT
CONTENT
card.permit('edit',Role[:admin])
card.permit('delete',Role[:admin])
card.save!
end
end
end

def self.down
end
end
18 changes: 18 additions & 0 deletions db/migrate/20091019222953_set_star_thank_plus_star_edit.rb
@@ -0,0 +1,18 @@
class SetStarThankPlusStarEdit < ActiveRecord::Migration
def self.up
User.as(:wagbot) do
card = Card.find_or_create :name=>"*thanks+*edit", :type=>"Basic"
if card.revisions.map(&:author).map(&:login).uniq == ["wagbot"]
card.content <<CONTENT
<p>Where to take people when they create a card of this type (if they don't have permission to see it). [[http://www.wagn.org/wagn/Custom_thank_you_messages_for_forms|Learn more about thank you messages.]]</p>
CONTENT
card.permit('edit',Role[:admin])
card.permit('delete',Role[:admin])
card.save!
end
end
end

def self.down
end
end
18 changes: 18 additions & 0 deletions db/migrate/20091019222956_set_star_input_plus_star_rform.rb
@@ -0,0 +1,18 @@
class SetStarInputPlusStarRform < ActiveRecord::Migration
def self.up
User.as(:wagbot) do
card = Card.find_or_create :name=>"*input+*rform", :type=>"Phrase"
if card.revisions.map(&:author).map(&:login).uniq == ["wagbot"]
card.content <<CONTENT
CONTENT
card.permit('edit',Role[:admin])
card.permit('delete',Role[:admin])
card.save!
end
end
end

def self.down
end
end
18 changes: 18 additions & 0 deletions db/migrate/20091019223000_set_star_input_plus_star_edit.rb
@@ -0,0 +1,18 @@
class SetStarInputPlusStarEdit < ActiveRecord::Migration
def self.up
User.as(:wagbot) do
card = Card.find_or_create :name=>"*input+*edit", :type=>"Basic"
if card.revisions.map(&:author).map(&:login).uniq == ["wagbot"]
card.content <<CONTENT
<p>[[http://wagn.org/wagn/Pointer|Learn more about Pointers' input interfaces.]]</p>
CONTENT
card.permit('edit',Role[:admin])
card.permit('delete',Role[:admin])
card.save!
end
end
end

def self.down
end
end
18 changes: 18 additions & 0 deletions db/migrate/20091019223004_set_star_input_plus_star_input.rb
@@ -0,0 +1,18 @@
class SetStarInputPlusStarInput < ActiveRecord::Migration
def self.up
User.as(:wagbot) do
card = Card.find_or_create :name=>"*input+*input", :type=>"Pointer"
if card.revisions.map(&:author).map(&:login).uniq == ["wagbot"]
card.content <<CONTENT
[[select]]
CONTENT
card.permit('edit',Role[:admin])
card.permit('delete',Role[:admin])
card.save!
end
end
end

def self.down
end
end
18 changes: 18 additions & 0 deletions db/migrate/20091019223007_set_star_option_label.rb
@@ -0,0 +1,18 @@
class SetStarOptionLabel < ActiveRecord::Migration
def self.up
User.as(:wagbot) do
card = Card.find_or_create :name=>"*option label", :type=>"Phrase"
if card.revisions.map(&:author).map(&:login).uniq == ["wagbot"]
card.content <<CONTENT
description
CONTENT
card.permit('edit',Role[:admin])
card.permit('delete',Role[:admin])
card.save!
end
end
end

def self.down
end
end
18 changes: 18 additions & 0 deletions db/migrate/20091019223011_set_star_option_label_plus_star_rform.rb
@@ -0,0 +1,18 @@
class SetStarOptionLabelPlusStarRform < ActiveRecord::Migration
def self.up
User.as(:wagbot) do
card = Card.find_or_create :name=>"*option label+*rform", :type=>"Phrase"
if card.revisions.map(&:author).map(&:login).uniq == ["wagbot"]
card.content <<CONTENT
CONTENT
card.permit('edit',Role[:admin])
card.permit('delete',Role[:admin])
card.save!
end
end
end

def self.down
end
end
18 changes: 18 additions & 0 deletions db/migrate/20091019223017_set_star_option_label_plus_star_edit.rb
@@ -0,0 +1,18 @@
class SetStarOptionLabelPlusStarEdit < ActiveRecord::Migration
def self.up
User.as(:wagbot) do
card = Card.find_or_create :name=>"*option label+*edit", :type=>"Basic"
if card.revisions.map(&:author).map(&:login).uniq == ["wagbot"]
card.content <<CONTENT
<p>Sets the plus card used to make labels for radio button and checkbox items associated with Pointers. [[http://www.wagn.org/wagn/Pointer|Learn more.]]</p>
CONTENT
card.permit('edit',Role[:admin])
card.permit('delete',Role[:admin])
card.save!
end
end
end

def self.down
end
end
2 changes: 1 addition & 1 deletion db/schema.rb
Expand Up @@ -9,7 +9,7 @@
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20090918151443) do
ActiveRecord::Schema.define(:version => 20091019220846) do

create_table "card_files", :force => true do |t|
t.string "filename"
Expand Down

0 comments on commit 9abcc14

Please sign in to comment.