I know this is a very simple question but I couldn't really find any clarification anywhere I look.
So if I have:
class Task < ActiveRecord::Base
belongs_to :group
end
and
class Group < ActiveRecord::Base
has_many :tasks
end
Does this prevents the creation of a new task record if the group_id given while creating task does not exist in group?
Because I've tried this and it's not preventing me from doing so unlike an actual foreign_key attribute on a SQL table (which rails does not add to its table)