{"id":19319694,"url":"https://github.com/hyperoslo/singleton-rails","last_synced_at":"2025-04-22T17:32:04.538Z","repository":{"id":13780375,"uuid":"16475508","full_name":"hyperoslo/singleton-rails","owner":"hyperoslo","description":"Adds singleton functionallity to ActiveRecord models","archived":false,"fork":false,"pushed_at":"2023-01-19T04:13:09.000Z","size":46,"stargazers_count":8,"open_issues_count":10,"forks_count":12,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-02T02:22:28.738Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hyperoslo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-03T10:01:12.000Z","updated_at":"2019-03-25T20:27:55.000Z","dependencies_parsed_at":"2023-02-10T20:15:34.720Z","dependency_job_id":null,"html_url":"https://github.com/hyperoslo/singleton-rails","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperoslo%2Fsingleton-rails","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperoslo%2Fsingleton-rails/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperoslo%2Fsingleton-rails/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperoslo%2Fsingleton-rails/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hyperoslo","download_url":"https://codeload.github.com/hyperoslo/singleton-rails/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250287671,"owners_count":21405658,"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-10T01:24:50.114Z","updated_at":"2025-04-22T17:32:04.246Z","avatar_url":"https://github.com/hyperoslo.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Singleton Rails\n\n[![Gem Version](https://img.shields.io/gem/v/singleton-rails.svg?style=flat)](https://rubygems.org/gems/singleton-rails)\n[![Dependency Status](https://img.shields.io/gemnasium/hyperoslo/singleton-rails.svg?style=flat)](https://gemnasium.com/hyperoslo/singleton-rails)\n[![Code Climate](https://img.shields.io/codeclimate/github/hyperoslo/singleton-rails.svg?style=flat)](https://codeclimate.com/github/hyperoslo/singleton-rails)\n\nAdds singleton functionallity to ActiveRecord models.\n\n**Supported Rails versions: 4.0.6 or higher**\n\nLicensed under the **MIT** license, see LICENSE for more information.\n\n## Installation\n\n    $ gem install singleton-rails\n\n## Usage\n\n### Include Singleton in your model\n\n```ruby\nclass AboutPage \u003c ActiveRecord::Base\n  include ActiveRecord::Singleton\nend\n```\n\n### Configure rails_admin\n\n```ruby\nRailsAdmin.config do |config|\n\n  config.actions do\n    dashboard\n\n    index \u0026RailsAdmin::Config::Actions::SingletonAwareIndex::PATCH\n    new \u0026RailsAdmin::Config::Actions::SingletonAwareNew::PATCH\n    export\n    history_index\n    bulk_delete\n\n    show\n    edit\n    delete \u0026RailsAdmin::Config::Actions::SingletonAwareDelete::PATCH\n    history_show\n    show_in_app\n  end\n\nend\n```\n\n### How to use it in your controller\n\n```ruby\n  class AboutPageController \u003c ApplicationController\n    def index\n      @about_page = AboutPage.instance\n    end\n  end\n```\n\n## Credits\n\nHyper made this. We're a digital communications agency with a passion for good code,\nand if you're using this library we probably want to hire you.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperoslo%2Fsingleton-rails","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyperoslo%2Fsingleton-rails","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperoslo%2Fsingleton-rails/lists"}