Skip to content

Commit fa6c354

Browse files
author
Simon Funke
committed
2 parents 858f178 + b1fcdcf commit fa6c354

16 files changed

+139
-0
lines changed

app/models/content_removal_request.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class ContentRemovalRequest < ActiveRecord::Base
2+
belongs_to :content_removal_request_period
3+
has_many :products
4+
has_many :reasons
5+
6+
attr_accessible :courtOrders, :executive, :items
7+
end
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class ContentRemovalRequestPeriod < ActiveRecord::Base
2+
has_many :content_removal_requests
3+
4+
attr_accessible :period_start, :period_end
5+
end

app/models/product.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class Product < ActiveRecord::Base
2+
belongs_to :content_removal_request
3+
4+
attr_accessible :name
5+
end

app/models/reason.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class Reason < ActiveRecord::Base
2+
belongs_to :content_removal_request
3+
4+
attr_accessible :name
5+
end
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class CreateProducts < ActiveRecord::Migration
2+
def self.up
3+
create_table :products do |t|
4+
t.string :name
5+
t.timestamps
6+
end
7+
end
8+
9+
def self.down
10+
drop_table :products
11+
end
12+
end
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class CreateReasons < ActiveRecord::Migration
2+
def self.up
3+
create_table :reasons do |t|
4+
t.string :name
5+
t.timestamps
6+
end
7+
end
8+
9+
def self.down
10+
drop_table :reasons
11+
end
12+
end
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
class CreateContentRemovalRequestPeriods < ActiveRecord::Migration
2+
def self.up
3+
create_table :content_removal_request_periods do |t|
4+
t.date :period_start
5+
t.date :period_end
6+
t.integer :country_id
7+
t.timestamps
8+
end
9+
end
10+
11+
def self.down
12+
drop_table :content_removal_request_periods
13+
end
14+
end
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
class CreateContentRemovalRequests < ActiveRecord::Migration
2+
def self.up
3+
create_table :content_removal_requests do |t|
4+
t.integer :content_removal_request_period_id
5+
t.integer :product_id
6+
t.integer :reason_id
7+
t.integer :courtOrders
8+
t.integer :executive
9+
t.integer :items
10+
t.timestamps
11+
end
12+
end
13+
14+
def self.down
15+
drop_table :content_removal_requests
16+
end
17+
end
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
one:
2+
period_start: 2011-11-09
3+
period_end: 2011-11-09
4+
country_id: 1
5+
6+
two:
7+
period_start: 2011-11-09
8+
period_end: 2011-11-09
9+
country_id: 1
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
one:
2+
content_removal_request_period_id: 1
3+
product_id: 1
4+
reason_id: 1
5+
courtOrders: 1
6+
executive: 1
7+
items: 1
8+
9+
two:
10+
content_removal_request_period_id: 1
11+
product_id: 1
12+
reason_id: 1
13+
courtOrders: 1
14+
executive: 1
15+
items: 1

test/fixtures/products.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
one:
2+
name: MyString
3+
4+
two:
5+
name: MyString

test/fixtures/reasons.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
one:
2+
name: MyString
3+
4+
two:
5+
name: MyString
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
require 'test_helper'
2+
3+
class ContentRemovalRequestPeriodTest < ActiveSupport::TestCase
4+
def test_should_be_valid
5+
assert ContentRemovalRequestPeriod.new.valid?
6+
end
7+
end
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
require 'test_helper'
2+
3+
class ContentRemovalRequestTest < ActiveSupport::TestCase
4+
def test_should_be_valid
5+
assert ContentRemovalRequest.new.valid?
6+
end
7+
end

test/unit/product_test.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
require 'test_helper'
2+
3+
class ProductTest < ActiveSupport::TestCase
4+
def test_should_be_valid
5+
assert Product.new.valid?
6+
end
7+
end

test/unit/reason_test.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
require 'test_helper'
2+
3+
class ReasonTest < ActiveSupport::TestCase
4+
def test_should_be_valid
5+
assert Reason.new.valid?
6+
end
7+
end

0 commit comments

Comments
 (0)