Setting rules and relationship for Posts.