{"id":28152826,"url":"https://github.com/platbr/where_unless_blank","last_synced_at":"2026-04-18T19:32:10.488Z","repository":{"id":56898149,"uuid":"211332189","full_name":"platbr/where_unless_blank","owner":"platbr","description":"This gem removes statements with null/blank values from query.","archived":false,"fork":false,"pushed_at":"2019-09-30T11:44:35.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-06T14:52:56.569Z","etag":null,"topics":["activerecord","activerecord-queries","rails"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/platbr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-27T14:01:49.000Z","updated_at":"2019-09-30T11:44:37.000Z","dependencies_parsed_at":"2022-08-20T17:40:26.994Z","dependency_job_id":null,"html_url":"https://github.com/platbr/where_unless_blank","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/platbr/where_unless_blank","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/platbr%2Fwhere_unless_blank","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/platbr%2Fwhere_unless_blank/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/platbr%2Fwhere_unless_blank/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/platbr%2Fwhere_unless_blank/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/platbr","download_url":"https://codeload.github.com/platbr/where_unless_blank/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/platbr%2Fwhere_unless_blank/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31982569,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T17:30:12.329Z","status":"ssl_error","status_checked_at":"2026-04-18T17:29:59.069Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["activerecord","activerecord-queries","rails"],"created_at":"2025-05-15T05:12:10.142Z","updated_at":"2026-04-18T19:32:10.466Z","avatar_url":"https://github.com/platbr.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WhereUnlessBlank\n\nThe behavior of \"where\" when querrying for a null value is include the statment and return rows with null value.\n\nThis gem creates a simple way to remove statements with null/blank values from query.\n\nVery usefull for search forms avoiding you to worry about unfilled fields.\n\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'where_unless_blank'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install where_unless_blank\n\n## Usage\nAfter install this gem three new methods will be available on `ActiveRecord::Base` instances.\n`where_unless_blank`, `ilike_unless_blank` and `like_unless_blank`.\n\n```\nPerson.where_unless_blank(age: params[:age]).ilike_unless_blank(name: params[:name])\nPerson.ilike_unless_blank(name: params[:name], surname: params[:surname])\nPerson.like_unless_blank(name: params[:name], surname: params[:surname])\n```\n\nIf u like short names u can use:\n\n`wub` or `where_ub` for `where_unless_blank`\n\n`iub` or `ilike_ub` for `ilike_unless_blank`\n\n`lub` or `like_ub` for `like_unless_blank`\n\nIf all params are blank it will behaivor like `all` method.\n\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/platbr/where_unless_blank.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplatbr%2Fwhere_unless_blank","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplatbr%2Fwhere_unless_blank","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplatbr%2Fwhere_unless_blank/lists"}