Add more classes in dummy app to test association moderation
This commit is contained in:
		
							parent
							
								
									7612d2f45e
								
							
						
					
					
						commit
						9c24f2fc1b
					
				
							
								
								
									
										3
									
								
								spec/internal/app/models/category.rb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								spec/internal/app/models/category.rb
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,3 @@
 | 
			
		||||
class Category < ActiveRecord::Base
 | 
			
		||||
  has_one :page
 | 
			
		||||
end
 | 
			
		||||
							
								
								
									
										3
									
								
								spec/internal/app/models/link.rb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								spec/internal/app/models/link.rb
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,3 @@
 | 
			
		||||
class Link < ActiveRecord::Base
 | 
			
		||||
  belongs_to :page
 | 
			
		||||
end
 | 
			
		||||
@ -1,2 +1,4 @@
 | 
			
		||||
class Page < ActiveRecord::Base
 | 
			
		||||
  has_many :links
 | 
			
		||||
  belongs_to :category
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
@ -1,10 +1,23 @@
 | 
			
		||||
ActiveRecord::Schema.define do
 | 
			
		||||
  create_table :categories, :force => true do |t|
 | 
			
		||||
    t.string :name
 | 
			
		||||
    t.timestamps
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  create_table :pages, :force => true do |t|
 | 
			
		||||
    t.integer :category_id
 | 
			
		||||
    t.string :name
 | 
			
		||||
    t.text   :content
 | 
			
		||||
    t.timestamps
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  create_table :links, :force => true do |t|
 | 
			
		||||
    t.integer :page_id
 | 
			
		||||
    t.string :name
 | 
			
		||||
    t.string :url
 | 
			
		||||
    t.timestamps
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  create_table :moderations, :force => true do |t|
 | 
			
		||||
    t.integer  :moderatable_id
 | 
			
		||||
    t.string   :moderatable_type
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user