Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanstout committed Aug 16, 2015
1 parent 393e0a3 commit 15110db
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/volt/models/validations/validations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,11 @@ def validations(*run_in_actions, &block)
end
end

# Called on the model inside of a validations block. Allows the user to
# control if validations should be run.
def validate(field_name = nil, options = nil, &block)
if block
# Setup a custom validation inside of the current validations block.
if field_name || options
fail 'validate should be passed a field name and options or a block, not both.'
end
Expand All @@ -68,7 +71,6 @@ def validate(field_name = nil, options = nil, &block)
@instance_validations[field_name] ||= {}
@instance_validations[field_name].merge!(options)
end
#puts "ivs in instance vlaidate: #{@instance_validations}"
end

def self.included(base)
Expand Down

0 comments on commit 15110db

Please sign in to comment.