impressionist icon indicating copy to clipboard operation
impressionist copied to clipboard

Add associations to models/impression.rb

Open sithara opened this issue 6 years ago • 1 comments

Hi Can we add impression.rb to app/models that takes in user_id from a table other than users table? I tried adding belongs_to association but it does not work.

class SomeUser < ActiveRecord::Base validate :user_name end

Is there some way I can access this as Impression.first.user_name => which gives me the current user name for that particular impression

Kind Regards Sithara

sithara avatar Mar 08 '18 11:03 sithara

I am also trying to do this. I tried to make a model like normal but it gets ignored by rails.

class Impression < ApplicationRecord
	belongs_to :sticker, optional: true
end

codeundercoverdev avatar Nov 12 '20 17:11 codeundercoverdev