Skip to content

Commit

Permalink
Extract method for evaluating defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
tfausak committed Mar 31, 2015
1 parent e50bc2b commit 4fbc5ff
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/active_interaction/base.rb
Expand Up @@ -147,6 +147,11 @@ def initialize_filter(filter)
attr_accessor filter.name
define_method("#{filter.name}?") { !public_send(filter.name).nil? }

eagerly_evaluate_default(filter)
end

# @param filter [Filter]
def eagerly_evaluate_default(filter)
default = filter.options[:default]
filter.default if default && !default.is_a?(Proc)
end
Expand Down

0 comments on commit 4fbc5ff

Please sign in to comment.