diff options
author | Peter Kozak <spag@golwen.net> | 2013-07-25 08:59:43 +0200 |
---|---|---|
committer | Peter Kozak <spag@golwen.net> | 2013-07-25 08:59:43 +0200 |
commit | 84cf7df5d512777fe0d04ff515de243302f826f7 (patch) | |
tree | 09c8785338a45c677d4d89e07d65b6633c5c1a10 | |
parent | c89039ec02c0e0acc3627a12a80ea75187e57cfc (diff) |
unnecessary constraint removed
-rw-r--r-- | app/models/group_membership.rb | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/app/models/group_membership.rb b/app/models/group_membership.rb index 0f04ae1..d9d48e7 100644 --- a/app/models/group_membership.rb +++ b/app/models/group_membership.rb @@ -12,8 +12,6 @@ class GroupMembership < ActiveRecord::Base :presence => true, :uniqueness => { :scope => [:group_id, :item_id] } - validate :validate_item_type_consitency - validates :item, :presence => true @@ -27,11 +25,4 @@ class GroupMembership < ActiveRecord::Base return fist_item.class.name end end - - def validate_item_type_consitency - type_allowed = self.item_type_allowed - if type_allowed && type_allowed != self.item_type - errors.add(:item_type, "must be of type: #{type_allowed}") - end - end end |