Skip to content

Commit c7fa6ad

Browse files
committed
various model fixes
1 parent e483410 commit c7fa6ad

8 files changed

+14
-12
lines changed

app/models/content_removal_request.rb

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
class ContentRemovalRequest < ActiveRecord::Base
22
belongs_to :content_removal_request_period
3+
belongs_to :product
4+
belongs_to :reason
35

4-
has_many :products
5-
has_many :reasons
6-
7-
attr_accessible :courtOrders, :executive, :items
6+
attr_accessible :court_orders, :executive, :items
87
end
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
class ContentRemovalRequestPeriod < ActiveRecord::Base
2+
belongs_to :country
3+
24
has_many :content_removal_requests
3-
has_one :country
45

56
attr_accessible :period_start, :period_end, :percentage_complied
67
end

app/models/country.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
class Country < ActiveRecord::Base
22
belongs_to :continent
3-
belongs_to :content_removal_request_period
3+
4+
has_many :content_removal_request_periods
5+
has_many :content_removal_requests, :through => :content_removal_request_periods
46

57
validates_presence_of :code, :name
68
validates_uniqueness_of :code

app/models/product.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
class Product < ActiveRecord::Base
2-
belongs_to :content_removal_request
2+
has_many :content_removal_requests
33

44
attr_accessible :name
55
end

app/models/reason.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
class Reason < ActiveRecord::Base
2-
belongs_to :content_removal_request
2+
has_many :content_removal_requests
33

44
attr_accessible :name
55
end

db/migrate/20111109012514_create_content_removal_requests.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ def self.up
44
t.integer :content_removal_request_period_id
55
t.integer :product_id
66
t.integer :reason_id
7-
t.integer :courtOrders
7+
t.integer :court_orders
88
t.integer :executive
99
t.integer :items
1010
t.timestamps

db/schema.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
t.integer "content_removal_request_period_id"
5050
t.integer "product_id"
5151
t.integer "reason_id"
52-
t.integer "courtOrders"
52+
t.integer "court_orders"
5353
t.integer "executive"
5454
t.integer "items"
5555
t.datetime "created_at"

test/fixtures/content_removal_requests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ one:
22
content_removal_request_period_id: 1
33
product_id: 1
44
reason_id: 1
5-
courtOrders: 1
5+
court_orders: 1
66
executive: 1
77
items: 1
88

99
two:
1010
content_removal_request_period_id: 1
1111
product_id: 1
1212
reason_id: 1
13-
courtOrders: 1
13+
court_orders: 1
1414
executive: 1
1515
items: 1

0 commit comments

Comments
 (0)