-
-
Save indigoviolet/034e4ec3967383395c88501c00f10b73 to your computer and use it in GitHub Desktop.
fin blog embed
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
class ActiveRecordRelation < Contracts::CallableClass | |
def initialize(klass) | |
@klass_contract = Contracts::Eq[klass] | |
end | |
def valid?(relation) | |
Contract.valid?(relation, ActiveRecord::Relation) && Contract.valid?(relation.klass, @klass_contract) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment