From 95dbe162f78bcf931711f5ed9515aee17bf96415 Mon Sep 17 00:00:00 2001 From: Ilya Konanykhin Date: Mon, 20 Mar 2017 00:09:01 +0600 Subject: [PATCH] BikeCsvImporter: make Bike#bike_model_id field accessible and specify it as a foreign key explicitly --- app/models/bike.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/models/bike.rb b/app/models/bike.rb index ef6b1ba..5135938 100644 --- a/app/models/bike.rb +++ b/app/models/bike.rb @@ -1,13 +1,14 @@ class Bike < ActiveRecord::Base acts_as_loggable - attr_accessible :shop_id, :serial_number, :bike_brand_id, :model, :color, :bike_style_id, :seat_tube_height, - :top_tube_length, :bike_wheel_size_id, :value, :bike_condition_id, :bike_purpose_id, :photo + attr_accessible :shop_id, :serial_number, :bike_brand_id, :bike_model_id, :model, :color, :bike_style_id, + :seat_tube_height, :top_tube_length, :bike_wheel_size_id, :value, :bike_condition_id, :bike_purpose_id, :photo has_many :transactions has_one :owner, :class_name => 'User' has_one :task_list, :as => :item, :dependent => :destroy belongs_to :bike_brand + belongs_to :bike_model belongs_to :bike_style belongs_to :bike_condition belongs_to :bike_purpose