{"id":17133584,"url":"https://github.com/toddkummer/films","last_synced_at":"2025-06-13T04:34:38.790Z","repository":{"id":235012124,"uuid":"667103223","full_name":"toddkummer/films","owner":"toddkummer","description":"Filmed in San Francisco","archived":false,"fork":false,"pushed_at":"2025-05-30T04:46:54.000Z","size":324,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-30T05:56:07.867Z","etag":null,"topics":["filterameter"],"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/toddkummer.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-07-16T16:42:54.000Z","updated_at":"2025-05-30T04:46:57.000Z","dependencies_parsed_at":"2024-07-28T00:30:02.547Z","dependency_job_id":"e8eb8191-65ff-4187-9b16-5b8599f2459d","html_url":"https://github.com/toddkummer/films","commit_stats":null,"previous_names":["toddkummer/films"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/toddkummer/films","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toddkummer%2Ffilms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toddkummer%2Ffilms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toddkummer%2Ffilms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toddkummer%2Ffilms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/toddkummer","download_url":"https://codeload.github.com/toddkummer/films/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toddkummer%2Ffilms/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259581623,"owners_count":22879889,"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":["filterameter"],"created_at":"2024-10-14T19:42:31.024Z","updated_at":"2025-06-13T04:34:38.747Z","avatar_url":"https://github.com/toddkummer.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Scenes of San Francisco\n\nGot a favorite movie filmed in San Francisco? There are lots of great choices.\n\n![Vertigo](https://image.tmdb.org/t/p/w154/15uOEfqBNTVtDUT7hGBVCka0rZz.jpg) ![The Rock](https://image.tmdb.org/t/p/w154/j5mxLNWjUlXUUk8weFBtnF4afIR.jpg) ![Mrs. Doubtfire](https://image.tmdb.org/t/p/w154/shHrSmXS5140o6sQzgzXxn3KqSm.jpg) ![Innerspace](https://image.tmdb.org/t/p/w154/A4azclZQjqeQxXvcok3rdUmuq8a.jpg)\n\nThis for fun project uses [a cool data set from Data SF](https://data.sfgov.org/Culture-and-Recreation/Film-Locations-in-San-Francisco/yitu-d5am/about_data) as well as movie posters from [The Movie DB (TMDB)](https://www.themoviedb.org/?language=en-US) all in service of providing a sample implementation for [the Filterameter gem](https://github.com/RockSolt/filterameter).\n\n## Filterameter\n\nFilterameter provides declarative filters for query classes or Rails controllers to reduce boilerplate code and increase readability. How many times have you seen (or written) this controller action?\n\n```ruby\ndef index\n  @films = Films.all\n  @films = @films.where(name: params[:name]) if params[:name]\n  @films = @films.joins(:film_locations).merge(FilmLocations.where(location_id: params[:location_id])) if params[:location_id]\n  @films = @films.directed_by(params[:director_id]) if params[:director_id]\n  @films = @films.written_by(params[:writer_id]) if params[:writer_id]\n  @films = @films.acted_by(params[:actor_id]) if params[:actor_id]\nend\n```\n\nIt's redundant code and a bit of a pain to write and maintain. Not to mention what RuboCop is going to say about it. (If your head just went there, I checked: [the 1987 film RoboCop](https://www.themoviedb.org/movie/5548-robocop?language=en-US) was set in Detroit but filmed primarily in Dallas.)\n\nWouldn't it be nice if you could just declare the filters that the controller accepts?\n\n```ruby\n  filter :name, partial: true\n  filter :location_id, association: :film_locations\n  filter :director_id, name: :directed_by\n  filter :writer_id, name: :written_by\n  filter :actor_id, name: :acted_by\n```\n\nThat's the value proposition of Filterameter. I hope you'll check it out.\n\n### Links\n\n- GitHub: https://github.com/RockSolt/filterameter\n- Ruby Gems: https://rubygems.org/gems/filterameter\n\n## Running the Application\n\nThe film data is checked into the repo as a CSV file and can be loaded with a rake task:\n\n```bash\nbundle exec rake film_data:load\n```\n\nOnce the data has been loaded, run the server with `bin/dev`.\n\n### What about the movie posters?!?\n\nThis product uses the TMDB API but is not endorsed or certified by TMDB.\n\nIn order to be able to look up the movie posters, you need to [create an API key with TMDB](https://developer.themoviedb.org/docs/getting-started). Then provide the key via environment variable `TMDB_API_READ_ACCESS_TOKEN`.\n\n## Credits\n\nFilm data from [DATA SF](https://data.sfgov.org/Culture-and-Recreation/Film-Locations-in-San-Francisco/yitu-d5am/about_data).\n\nMovie posters from The Movie DB.\n\n\u003cimg src=\"https://www.themoviedb.org/assets/2/v4/logos/v2/blue_square_1-5bdc75aaebeb75dc7ae79426ddd9be3b2be1e342510f8202baf6bffa71d7f5c4.svg\" style=\"width: 200px;\"/\u003e\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoddkummer%2Ffilms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoddkummer%2Ffilms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoddkummer%2Ffilms/lists"}