{"id":16753475,"url":"https://github.com/thbar/activerecord-experiments","last_synced_at":"2025-10-24T23:07:25.076Z","repository":{"id":4185210,"uuid":"5302480","full_name":"thbar/activerecord-experiments","owner":"thbar","description":null,"archived":false,"fork":false,"pushed_at":"2012-08-07T08:14:04.000Z","size":104,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-22T18:11:33.282Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thbar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-08-05T10:02:57.000Z","updated_at":"2023-07-01T21:27:02.000Z","dependencies_parsed_at":"2022-08-25T20:40:56.752Z","dependency_job_id":null,"html_url":"https://github.com/thbar/activerecord-experiments","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/thbar%2Factiverecord-experiments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thbar%2Factiverecord-experiments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thbar%2Factiverecord-experiments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thbar%2Factiverecord-experiments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thbar","download_url":"https://codeload.github.com/thbar/activerecord-experiments/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243830922,"owners_count":20354850,"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":[],"created_at":"2024-10-13T02:50:12.141Z","updated_at":"2025-10-24T23:07:25.029Z","avatar_url":"https://github.com/thbar.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"This repository is a playground around various ways to handle prices with ActiveRecord.\n\n## Already implemented\n\n#### DecimalPriceProduct\n\nUses a decimal column to implement the price attribute.\n\nIssue: `price_before_type_cast` will equal `nil` even if you pass a blank string, so you cannot rely on `price_before_type_cast` to provide a different treatment to a blank input if needed.\n\nLinks:\n\n- https://github.com/rails/rails/blob/4bbd05c90e5a62c0316307b3ca7c2262ed98b567/activemodel/lib/active_model/validations/numericality.rb#L95\n\n## To be implemented\n\n* composed_of (which was removed, then is back for now)\n* custom accessors as advised on the commit that first removed composed_of\n* money-rails (which implements a certain version of custom accessor)\n\n## How to run\n\nCreate `db/config.yml` based on 'db/config.yml.sample' then run:\n\n```\nbundle install\nbundle exec rake db:create\nbundle exec rake db:migrate\nbundle exec rake spec\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthbar%2Factiverecord-experiments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthbar%2Factiverecord-experiments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthbar%2Factiverecord-experiments/lists"}