Skip to content

Commit

Permalink
models created
Browse files Browse the repository at this point in the history
  • Loading branch information
chandra committed Apr 9, 2012
1 parent 78ae875 commit 1de9812
Show file tree
Hide file tree
Showing 12 changed files with 96 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/bill.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Bill < ActiveRecord::Base
end
2 changes: 2 additions & 0 deletions app/models/billitem.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Billitem < ActiveRecord::Base
end
2 changes: 2 additions & 0 deletions app/models/product.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Product < ActiveRecord::Base
end
12 changes: 12 additions & 0 deletions db/migrate/20120409031936_create_products.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class CreateProducts < ActiveRecord::Migration
def change
create_table :products do |t|
t.string :code
t.string :product
t.integer :price
t.integer :quantity

t.timestamps
end
end
end
8 changes: 8 additions & 0 deletions db/migrate/20120409032044_create_bills.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class CreateBills < ActiveRecord::Migration
def change
create_table :bills do |t|

t.timestamps
end
end
end
12 changes: 12 additions & 0 deletions db/migrate/20120409032327_create_billitems.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class CreateBillitems < ActiveRecord::Migration
def change
create_table :billitems do |t|
t.integer :bill_id
t.integer :product_id
t.integer :price
t.integer :quant

t.timestamps
end
end
end
13 changes: 13 additions & 0 deletions test/fixtures/billitems.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html

one:
bill_id: 1
product_id: 1
price: 1
quant: 1

two:
bill_id: 1
product_id: 1
price: 1
quant: 1
11 changes: 11 additions & 0 deletions test/fixtures/bills.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html

# This model initially had no columns defined. If you add columns to the
# model remove the '{}' from the fixture names and add the columns immediately
# below each fixture, per the syntax in the comments below
#
one: {}
# column: value
#
two: {}
# column: value
13 changes: 13 additions & 0 deletions test/fixtures/products.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html

one:
code: MyString
product: MyString
price: 1
quantity: 1

two:
code: MyString
product: MyString
price: 1
quantity: 1
7 changes: 7 additions & 0 deletions test/unit/bill_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'test_helper'

class BillTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
7 changes: 7 additions & 0 deletions test/unit/billitem_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'test_helper'

class BillitemTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
7 changes: 7 additions & 0 deletions test/unit/product_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'test_helper'

class ProductTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

0 comments on commit 1de9812

Please sign in to comment.