[logaling-commit] logaling/logaling-server [master] Add association

Zurück zum Archiv-Index

SUZUKI Miho null+****@clear*****
Fri Sep 21 15:08:22 JST 2012


SUZUKI Miho	2012-09-21 15:08:22 +0900 (Fri, 21 Sep 2012)

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

  Merged 971b851: Merge pull request #14 from logaling/prioritize-the-search

  Log:
    Add association

  Added files:
    db/migrate/20120921055727_add_reference_to_user_config.rb
  Modified files:
    app/models/user.rb
    app/models/user_config.rb
    db/schema.rb

  Modified: app/models/user.rb (+1 -0)
===================================================================
--- app/models/user.rb    2012-09-21 14:46:25 +0900 (ab2798e)
+++ app/models/user.rb    2012-09-21 15:08:22 +0900 (cf7b1ef)
@@ -12,4 +12,5 @@ class User < ActiveRecord::Base
   attr_accessible :name, :provider, :uid
 
   has_many :user_glossaries
+  has_one :user_config
 end

  Modified: app/models/user_config.rb (+2 -0)
===================================================================
--- app/models/user_config.rb    2012-09-21 14:46:25 +0900 (3e81e07)
+++ app/models/user_config.rb    2012-09-21 15:08:22 +0900 (e3e5ac4)
@@ -1,3 +1,5 @@
 class UserConfig < ActiveRecord::Base
   attr_accessible :glossary, :source_language, :target_language
+
+  has_one :user
 end

  Added: db/migrate/20120921055727_add_reference_to_user_config.rb (+6 -0) 100644
===================================================================
--- /dev/null
+++ db/migrate/20120921055727_add_reference_to_user_config.rb    2012-09-21 15:08:22 +0900 (14d5d38)
@@ -0,0 +1,6 @@
+class AddReferenceToUserConfig < ActiveRecord::Migration
+  def change
+    add_column :user_configs, :user_id, :integer
+    add_index :user_configs, :user_id
+  end
+end

  Modified: db/schema.rb (+4 -1)
===================================================================
--- db/schema.rb    2012-09-21 14:46:25 +0900 (a14088e)
+++ db/schema.rb    2012-09-21 15:08:22 +0900 (0af3122)
@@ -11,7 +11,7 @@
 #
 # It's strongly recommended to check this file into your version control system.
 
-ActiveRecord::Schema.define(:version => 20120921054114) do
+ActiveRecord::Schema.define(:version => 20120921055727) do
 
   create_table "github_projects", :force => true do |t|
     t.string   "owner"
@@ -26,8 +26,11 @@ ActiveRecord::Schema.define(:version => 20120921054114) do
     t.string   "target_language"
     t.datetime "created_at",      :null => false
     t.datetime "updated_at",      :null => false
+    t.integer  "user_id"
   end
 
+  add_index "user_configs", ["user_id"], :name => "index_user_configs_on_user_id"
+
   create_table "user_glossaries", :force => true do |t|
     t.integer  "user_id",         :null => false
     t.string   "name",            :null => false
-------------- next part --------------
An HTML attachment was scrubbed...
Download 



More information about the logaling-commit mailing list
Zurück zum Archiv-Index