Last active
December 31, 2015 19:59
-
-
Save arkiver/8037427 to your computer and use it in GitHub Desktop.
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
(rdb:1) @filter | |
{:grid_id=>8, :from=>Mon, 16 Dec 2013 10:27:58 UTC +00:00, :to=>Tue, 24 Dec 2013 10:27:58 UTC +00:00, :completed=>false} | |
(rdb:1) @filter[:completed].present? | |
false | |
(rdb:1) @filter[:to].present? | |
true | |
(rdb:1) | |
# Rails source of present? | |
# https://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/object/blank.rb#L19 | |
# An object is present if it's not <tt>blank?</tt>. | |
def present? | |
!blank? | |
end | |
# An object is blank if it's false, empty, or a whitespace string. | |
@filter.key?(:completed) instead ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment