{"id":21519363,"url":"https://github.com/alexwayfer/formalism-model_forms","last_synced_at":"2025-03-17T16:49:50.192Z","repository":{"id":39657678,"uuid":"278476454","full_name":"AlexWayfer/formalism-model_forms","owner":"AlexWayfer","description":"Standard Formalism forms for Sequel ModelsaStandard Formalism forms for Sequel Models, such like create, find, delete, etc.","archived":false,"fork":false,"pushed_at":"2024-04-29T07:10:45.000Z","size":139,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-29T08:29:34.492Z","etag":null,"topics":[],"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/AlexWayfer.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2020-07-09T21:39:13.000Z","updated_at":"2022-01-01T13:51:13.000Z","dependencies_parsed_at":"2023-12-12T22:23:54.454Z","dependency_job_id":"1e5ddf52-031e-4745-a1fe-05267a7b1ac2","html_url":"https://github.com/AlexWayfer/formalism-model_forms","commit_stats":{"total_commits":122,"total_committers":2,"mean_commits":61.0,"dds":"0.39344262295081966","last_synced_commit":"2dfe08103dbfb9c8b3e3e46184feeb300e6aa8b4"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexWayfer%2Fformalism-model_forms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexWayfer%2Fformalism-model_forms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexWayfer%2Fformalism-model_forms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexWayfer%2Fformalism-model_forms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlexWayfer","download_url":"https://codeload.github.com/AlexWayfer/formalism-model_forms/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244074436,"owners_count":20393965,"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-11-24T00:57:33.809Z","updated_at":"2025-03-17T16:49:50.165Z","avatar_url":"https://github.com/AlexWayfer.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Formalism Model Forms\n\n[![Cirrus CI - Base Branch Build Status](https://img.shields.io/cirrus/github/AlexWayfer/formalism-model_forms?style=flat-square)](https://cirrus-ci.com/github/AlexWayfer/formalism-model_forms)\n[![Codecov branch](https://img.shields.io/codecov/c/github/AlexWayfer/formalism-model_forms/main.svg?style=flat-square)](https://codecov.io/gh/AlexWayfer/formalism-model_forms)\n[![Code Climate](https://img.shields.io/codeclimate/maintainability/AlexWayfer/formalism-model_forms.svg?style=flat-square)](https://codeclimate.com/github/AlexWayfer/formalism-model_forms)\n[![Depfu](https://img.shields.io/depfu/AlexWayfer/benchmark_toys?style=flat-square)](https://depfu.com/repos/github/AlexWayfer/formalism-model_forms)\n[![Inline docs](https://inch-ci.org/github/AlexWayfer/formalism-model_forms.svg?branch=main)](https://inch-ci.org/github/AlexWayfer/formalism-model_forms)\n[![License](https://img.shields.io/github/license/AlexWayfer/formalism-model_forms.svg?style=flat-square)](LICENSE.txt)\n[![Gem](https://img.shields.io/gem/v/formalism-model_forms.svg?style=flat-square)](https://rubygems.org/gems/formalism-model_forms)\n\nRuby gem with standard [Formalism](https://github.com/AlexWayfer/formalism) forms\nfor ([Sequel](https://sequel.jeremyevans.net/)) models.\nUsed by [Flame Generate Toys](https://github.com/AlexWayfer/flame_generate_toys).\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'formalism-model_forms'\n```\n\nAnd then execute:\n\n```shell\nbundle install\n```\n\nOr install it yourself as:\n\n```shell\ngem install formalism-model_forms\n```\n\n## Usage\n\n```ruby\n# forms/_base.rb\n\nrequire 'formalism/model_forms'\n\n## Define base form and model forms via gem\nmodule MyProject\n  module Forms\n    ## Base class for forms\n    class Base \u003c Formalism::Form\n    end\n  end\n\n  Formalism::ModelForms.define_for_project self\nend\n```\n\n`.define_for_project` requires project namespace (`self` in the example above)\nand allows such options:\n\n*   `:forms_namespace`, default is `project_namespace::Forms`\n*   `:models_namespace`, default is `project_namespace::Models`\n\n```ruby\n# forms/user/create.rb\n\nmodule MyProject\n  module Forms\n    module User\n      class Create \u003c Formalism::ModelForms::Create\n        field :name\n\n        private\n\n        def validate\n          errors.add 'Name is not provided' if name.to_s.empty?\n        end\n\n        # `execute` is inherited from `Formalism::ModelForms`\n      end\n    end\n  end\nend\n```\n\n## Development\n\nAfter checking out the repo, run `bundle install` to install dependencies.\n\nThen, run `toys rspec` to run the tests.\n\nTo install this gem onto your local machine, run `toys gem install`.\n\nTo release a new version, run `toys gem release %version%`.\nSee how it works [here](https://github.com/AlexWayfer/gem_toys#release).\n\n## Contributing\n\nBug reports and pull requests are welcome on [GitHub](https://github.com/AlexWayfer/formalism).\n\n## License\n\nThe gem is available as open source under the terms of the\n[MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexwayfer%2Fformalism-model_forms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexwayfer%2Fformalism-model_forms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexwayfer%2Fformalism-model_forms/lists"}