[logaling-commit] logaling/logaling-server [prioritize-the-search] Add UserGlossary model and user_glossaries table

Back to archive index

SUZUKI Miho null+****@clear*****
Tue Sep 25 20:59:41 JST 2012


SUZUKI Miho	2012-09-06 18:07:13 +0900 (Thu, 06 Sep 2012)

  New Revision: 72ad59b0d852552d0c58159c1b87c16188a60dc7
  https://github.com/logaling/logaling-server/commit/72ad59b0d852552d0c58159c1b87c16188a60dc7

  Merged c5d082c: Merge pull request #13 from logaling/enable-creating-user-glossary

  Log:
    Add UserGlossary model and user_glossaries table

  Added files:
    app/models/user_glossary.rb
    db/migrate/20120906084519_create_user_glossaries.rb
    spec/models/user_glossary_spec.rb
  Modified files:
    db/schema.rb

  Added: app/models/user_glossary.rb (+5 -0) 100644
===================================================================
--- /dev/null
+++ app/models/user_glossary.rb    2012-09-06 18:07:13 +0900 (6f47958)
@@ -0,0 +1,5 @@
+class UserGlossary < ActiveRecord::Base
+  attr_accessible :name, :source_language, :target_language
+
+  belongs_to :user
+end

  Added: db/migrate/20120906084519_create_user_glossaries.rb (+13 -0) 100644
===================================================================
--- /dev/null
+++ db/migrate/20120906084519_create_user_glossaries.rb    2012-09-06 18:07:13 +0900 (9808ec1)
@@ -0,0 +1,13 @@
+class CreateUserGlossaries < ActiveRecord::Migration
+  def change
+    create_table :user_glossaries do |t|
+      t.references :user, :null => false
+      t.string :name, :null => false
+      t.string :source_language, :null => false
+      t.string :target_language, :null => false
+
+      t.timestamps
+    end
+    add_index :user_glossaries, :user_id
+  end
+end

  Modified: db/schema.rb (+12 -1)
===================================================================
--- db/schema.rb    2012-09-05 17:26:58 +0900 (ff3ce6b)
+++ db/schema.rb    2012-09-06 18:07:13 +0900 (f259859)
@@ -11,7 +11,7 @@
 #
 # It's strongly recommended to check this file into your version control system.
 
-ActiveRecord::Schema.define(:version => 20120823022542) do
+ActiveRecord::Schema.define(:version => 20120906084519) do
 
   create_table "github_projects", :force => true do |t|
     t.string   "owner"
@@ -20,6 +20,17 @@ ActiveRecord::Schema.define(:version => 20120823022542) do
     t.datetime "updated_at", :null => false
   end
 
+  create_table "user_glossaries", :force => true do |t|
+    t.integer  "user_id",         :null => false
+    t.string   "name",            :null => false
+    t.string   "source_language", :null => false
+    t.string   "target_language", :null => false
+    t.datetime "created_at",      :null => false
+    t.datetime "updated_at",      :null => false
+  end
+
+  add_index "user_glossaries", ["user_id"], :name => "index_user_glossaries_on_user_id"
+
   create_table "users", :force => true do |t|
     t.string   "provider"
     t.string   "uid"

  Added: spec/models/user_glossary_spec.rb (+5 -0) 100644
===================================================================
--- /dev/null
+++ spec/models/user_glossary_spec.rb    2012-09-06 18:07:13 +0900 (9c21adf)
@@ -0,0 +1,5 @@
+require 'spec_helper'
+
+describe UserGlossary do
+  pending "add some examples to (or delete) #{__FILE__}"
+end
-------------- next part --------------
An HTML attachment was scrubbed...
下載 



More information about the logaling-commit mailing list
Back to archive index