Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jia Wu
committed
Mar 16, 2012
1 parent
b574981
commit 544cd71
Showing
9 changed files
with
65 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,5 @@ | |||
module DeviceSpecification | |||
def self.table_name_prefix | |||
'device_specification_' | |||
end | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,3 @@ | |||
class DeviceSpecification::Category < ActiveRecord::Base | |||
has_many :properties | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,3 @@ | |||
class DeviceSpecification::Property < ActiveRecord::Base | |||
belongs_to :category | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
db/migrate/20120316214736_create_device_specification_categories.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,8 @@ | |||
class CreateDeviceSpecificationCategories < ActiveRecord::Migration | |||
def change | |||
create_table :device_specification_categories do |t| | |||
t.string :name | |||
t.timestamps | |||
end | |||
end | |||
end |
9 changes: 9 additions & 0 deletions
9
db/migrate/20120316215156_create_device_specification_properties.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,9 @@ | |||
class CreateDeviceSpecificationProperties < ActiveRecord::Migration | |||
def change | |||
create_table :device_specification_properties do |t| | |||
t.string :name | |||
t.belongs_to :category | |||
t.timestamps | |||
end | |||
end | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,29 @@ | |||
# encoding: UTF-8 | |||
# This file is auto-generated from the current state of the database. Instead | |||
# of editing this file, please use the migrations feature of Active Record to | |||
# incrementally modify your database, and then regenerate this schema definition. | |||
# | |||
# Note that this schema.rb definition is the authoritative source for your | |||
# database schema. If you need to create the application database on another | |||
# system, you should be using db:schema:load, not running all the migrations | |||
# from scratch. The latter is a flawed and unsustainable approach (the more migrations | |||
# you'll amass, the slower it'll run and the greater likelihood for issues). | |||
# | |||
# It's strongly recommended to check this file into your version control system. | |||
|
|||
ActiveRecord::Schema.define(:version => 20120316215156) do | |||
|
|||
create_table "device_specification_categories", :force => true do |t| | |||
t.string "name" | |||
t.datetime "created_at", :null => false | |||
t.datetime "updated_at", :null => false | |||
end | |||
|
|||
create_table "device_specification_properties", :force => true do |t| | |||
t.string "name" | |||
t.integer "category_id" | |||
t.datetime "created_at", :null => false | |||
t.datetime "updated_at", :null => false | |||
end | |||
|
|||
end |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters