{"id":19723498,"url":"https://github.com/remind101/activerecord-poro","last_synced_at":"2025-04-29T22:30:58.743Z","repository":{"id":16104703,"uuid":"18849712","full_name":"remind101/activerecord-poro","owner":"remind101","description":"Associations for plain old ruby objects","archived":false,"fork":false,"pushed_at":"2014-04-16T18:15:35.000Z","size":152,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":92,"default_branch":"master","last_synced_at":"2025-04-05T20:01:57.261Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/remind101.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-16T17:52:38.000Z","updated_at":"2017-03-08T17:09:41.000Z","dependencies_parsed_at":"2022-09-02T14:26:05.947Z","dependency_job_id":null,"html_url":"https://github.com/remind101/activerecord-poro","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remind101%2Factiverecord-poro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remind101%2Factiverecord-poro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remind101%2Factiverecord-poro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remind101%2Factiverecord-poro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remind101","download_url":"https://codeload.github.com/remind101/activerecord-poro/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251207187,"owners_count":21552524,"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-11T23:22:24.172Z","updated_at":"2025-04-29T22:30:58.376Z","avatar_url":"https://github.com/remind101.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ActiveRecord::Poro\n\nThis gem allows for plain old ruby objects to be associated with your ActiveRecord models.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'activerecord-poro'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install activerecord-poro\n\n## Usage\n\n```ruby\nclass User \u003c ActiveRecord::Base\nend\n\nclass Message \u003c ActiveRecord::Base\nend\n\nclass Activity\n  include Virtus.model\n\n  attribute :action, String\n  \n  attribute :subject_type, String\n  attribute :subject_id, Integer\n\n  attribute :creator_type, String\n  attribute :creator_id, Integer\n\n  belongs_to :subject, polymorphic: true\n  belongs_to :creator, polymorphic: true\n\n  def initialize(*args)\n    @association_cache = {}\n    super\n  end\nend\n\nmessage = Message.create\nuser    = User.create\n\nactivity = Activity.new(\n  action: 'message.sent',\n  creator_type: 'User',\n  creator_id: user.id,\n  subject_type: 'Message',\n  subject_id: message.id\n)\n\nactivity.subject\n# =\u003e #\u003cMessage @id=1\u003e\n\nactivity.creator\n# =\u003e #\u003cUser @id=1\u003e\n```\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremind101%2Factiverecord-poro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremind101%2Factiverecord-poro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremind101%2Factiverecord-poro/lists"}