16 lines
490 B
Ruby
16 lines
490 B
Ruby
class Domain::UserPostCreation < ReduxApplicationRecord
|
|
include AttrJsonRecordAliases
|
|
self.table_name = "domain_user_post_creations"
|
|
self.primary_key = %i[user_id post_id]
|
|
|
|
validates :user_id, uniqueness: { scope: :post_id }
|
|
|
|
belongs_to :post,
|
|
class_name: "::Domain::Post",
|
|
inverse_of: :user_post_creations
|
|
belongs_to :user,
|
|
class_name: "::Domain::User",
|
|
inverse_of: :user_post_creations,
|
|
counter_cache: true
|
|
end
|