From 60fbc344d1ebae794387de005040810faeb71277 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Mon, 14 Jul 2014 21:30:11 +0800 Subject: [PATCH] rss2_id added and some changes in form --- app/models/patent.rb | 3 ++- app/models/patent_type.rb | 2 +- app/views/admin/patents/_form.html.erb | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/models/patent.rb b/app/models/patent.rb index 063fac1..b3b467b 100644 --- a/app/models/patent.rb +++ b/app/models/patent.rb @@ -4,7 +4,7 @@ class Patent include OrbitModel::Status include Slug - belongs_to :patent_type + has_and_belongs_to_many :patent_types belongs_to :member_profile field :patent_title, as: :slug_title, localize: true @@ -18,6 +18,7 @@ class Patent field :publish_date , :type => Date field :url field :note + field :rss2_id field :create_user_id, :type => BSON::ObjectId field :update_user_id, :type => BSON::ObjectId diff --git a/app/models/patent_type.rb b/app/models/patent_type.rb index e5e90f4..8202881 100644 --- a/app/models/patent_type.rb +++ b/app/models/patent_type.rb @@ -4,6 +4,6 @@ class PatentType field :title, localize: true - has_many :patents + has_and_belongs_to_many :patents end \ No newline at end of file diff --git a/app/views/admin/patents/_form.html.erb b/app/views/admin/patents/_form.html.erb index c39dac7..85ce1f0 100644 --- a/app/views/admin/patents/_form.html.erb +++ b/app/views/admin/patents/_form.html.erb @@ -53,7 +53,9 @@
- <%= f.select :patent_type_id, @patent_types.collect {|t| [ t.title, t.id ]} %> + <% @patent_types.each do |pt| %> + /> <%= pt.title %> + <% end %>