lib/key_vortex/field.rb in key-vortex-0.1.4 vs lib/key_vortex/field.rb in key-vortex-0.2.0

- old
+ new

@@ -15,11 +15,15 @@ @limitation.add_constraint(*constraints_hash.map do |attribute, value| KeyVortex::Constraint.build(attribute, value) end) end - def prohibited_by?(adapter) + def within?(adapter) limitation = adapter.limitation_for(self) - limitation&.prohibits?(self.limitation) + !limitation || self.limitation.within?(limitation) + end + + def accepts?(value) + limitation.accepts?(value) end end end