Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
antebarac committed Jul 25, 2013
1 parent 8dc51cc commit a9c9bc8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/ad_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ class AdFilter
def initialize(params = {})
params ||= {}
params.each do |key, value|
if(value.instance_of?(Symbol) && value.instance_of(String) && self.respond_to?(value))
if((value.instance_of?(Symbol) || value.instance_of?(String)) && self.respond_to?(key))
value = value.present? && value.to_i != 0 ? value.to_i : nil unless key.to_sym == :query
value = nil if value.blank?
instance_variable_set("@#{key}", value) unless value.nil?
end
end
print self.to_yaml
end

def clone_without(skip_attribute)
Expand Down

0 comments on commit a9c9bc8

Please sign in to comment.