{"id":19711057,"url":"https://github.com/jenorish/lazy_find","last_synced_at":"2025-04-29T17:31:33.704Z","repository":{"id":56880835,"uuid":"137482847","full_name":"jenorish/lazy_find","owner":"jenorish","description":"Simplified the first,last,take methods in ActiveRecord","archived":false,"fork":false,"pushed_at":"2018-06-18T07:03:45.000Z","size":20,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-26T07:07:45.698Z","etag":null,"topics":["activerecord","first","last","rails","take"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jenorish.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-15T12:03:43.000Z","updated_at":"2023-12-08T14:43:18.000Z","dependencies_parsed_at":"2022-08-20T22:31:19.965Z","dependency_job_id":null,"html_url":"https://github.com/jenorish/lazy_find","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenorish%2Flazy_find","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenorish%2Flazy_find/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenorish%2Flazy_find/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenorish%2Flazy_find/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jenorish","download_url":"https://codeload.github.com/jenorish/lazy_find/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251549251,"owners_count":21607377,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","first","last","rails","take"],"created_at":"2024-11-11T22:09:40.254Z","updated_at":"2025-04-29T17:31:33.404Z","avatar_url":"https://github.com/jenorish.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LazyFind\n\n## Description\n   \n    Simplified the first,last,take methods in ActiveRecord.So instead of using where and first, you can directly use first.\n\n\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'lazy_find'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install lazy_find\n\n## Usage\n\n  Simplified the first,last,take methods in ActiveRecord.\n\n        Find the first record (or first N records if a parameter is supplied).\n\n   Old Syntax:\n\n        Person.where(:email =\u003e \"jenorish@gmail\").first\n\n   New Syntax:\n\n        Person.first(:email =\u003e \"jenorish@gmail\")\n\n        # returns the first three objects fetched by SELECT * FROM people WHERE email= 'jenorish@gmail.com'  ORDER BY people.id LIMIT 3\n \n## Order \n\n   We can find first value with order as well \n\n     Person.first(:email =\u003e \"jenorish@gmail\",:order =\u003e \"created_at\")\n\n## Select\n  \n   Pass select key to select some filds\n\n     Person.first(:email =\u003e \"jenorish@gmail\",:order =\u003e \"created_at\", select: [:name, :email])\n\n## New methods\n\n  We can use find all in lazy way by passing like below\n\n    Person.lazy_all(:email =\u003e \"jenorish@gmail\",:order =\u003e \"created_at\") \n\n And support `Rails 3` where syntax\n\n     Person.lazy_where(:email =\u003e \"jenorish@gmail\",:order =\u003e \"created_at\") \n\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/jenorish/lazy_find. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the LazyFind project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/jenorish/lazy_find/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenorish%2Flazy_find","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjenorish%2Flazy_find","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenorish%2Flazy_find/lists"}