Created
October 13, 2016 12:06
-
-
Save bsylvain/8bcd07ccb2ec06a8750506645bf43010 to your computer and use it in GitHub Desktop.
can it be reduced to a one liner ?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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