We have 2 PostgreSQL tables as follows:
Keywords table: id, keyword (string)
Joins table: id, keyword_ids (integers array)
Now, I want to add associations to both Keywords and Aliases model as follows
class Keyword < ActiveRecord::Base
has_many :joins
end
class Join < ActiveRecord::Base
belongs_to :keywords foreign_key: 'keyword_ids'
end
How can I do that in Rails 4 and PostgreSQL 9.3?