Skip to content

Instantly share code, notes, and snippets.

@bsylvain
Created October 13, 2016 12:06
Show Gist options
  • Save bsylvain/8bcd07ccb2ec06a8750506645bf43010 to your computer and use it in GitHub Desktop.
Save bsylvain/8bcd07ccb2ec06a8750506645bf43010 to your computer and use it in GitHub Desktop.
can it be reduced to a one liner ?
validate :relation_with_same_tenant
.......
private
def relation_with_same_tenant
if self.shop_id!=ui_listable.shop_id
self.errors.add(:ui_listable,"ERROR MESSAGE")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment