Skip to content

Commit

Permalink
Keep consistency on allow_blank and allow_nil qualifiers
Browse files Browse the repository at this point in the history
After some discussion[1] was decided that these qualifiers do not accept
any parameter.

thoughtbot#722
  • Loading branch information
maurogeorge authored and guialbuk committed Aug 31, 2018
1 parent 7f070cb commit 78a482f
Showing 1 changed file with 4 additions and 5 deletions.
Expand Up @@ -310,18 +310,17 @@ def in_range(range)
self
end

def allow_blank(allow_blank = true)
@options[:allow_blank] = allow_blank
def allow_blank
@options[:allow_blank] = true
self
end

def expects_to_allow_blank?
@options[:allow_blank]
end

def allow_nil(allow_nil = true)
@options[:allow_nil] = allow_nil
self
def allow_nil
@options[:allow_nil] = true
end

def expects_to_allow_nil?
Expand Down

0 comments on commit 78a482f

Please sign in to comment.