{"id":22808359,"url":"https://github.com/sixarm/sixarm_ruby_active_record_mock","last_synced_at":"2025-03-30T21:15:52.196Z","repository":{"id":919167,"uuid":"682397","full_name":"SixArm/sixarm_ruby_active_record_mock","owner":"SixArm","description":"SixArm.com » Ruby » ActiveRecord mock object for testing Rails","archived":false,"fork":false,"pushed_at":"2023-09-15T19:27:37.000Z","size":328,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-02-06T00:26:12.802Z","etag":null,"topics":["activerecord","gem","mock","rails","ruby"],"latest_commit_sha":null,"homepage":"http://sixarm.com","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/SixArm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2010-05-23T23:22:23.000Z","updated_at":"2023-09-15T19:27:41.000Z","dependencies_parsed_at":"2025-02-06T00:36:28.480Z","dependency_job_id":null,"html_url":"https://github.com/SixArm/sixarm_ruby_active_record_mock","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/SixArm%2Fsixarm_ruby_active_record_mock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SixArm%2Fsixarm_ruby_active_record_mock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SixArm%2Fsixarm_ruby_active_record_mock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SixArm%2Fsixarm_ruby_active_record_mock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SixArm","download_url":"https://codeload.github.com/SixArm/sixarm_ruby_active_record_mock/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246379366,"owners_count":20767696,"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":["activerecord","gem","mock","rails","ruby"],"created_at":"2024-12-12T11:09:25.902Z","updated_at":"2025-03-30T21:15:52.189Z","avatar_url":"https://github.com/SixArm.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SixArm.com → Ruby → \u003cbr\u003e ActiveRecord mock object for testing Rails\n\n* Doc: \u003chttp://sixarm.com/sixarm_ruby_active_record_mock/doc\u003e\n* Gem: \u003chttp://rubygems.org/gems/sixarm_ruby_active_record_mock\u003e\n* Repo: \u003chttp://github.com/sixarm/sixarm_ruby_active_record_mock\u003e\n\u003c!--header-shut--\u003e\n\n\n## Introduction\n\nA simple mock object that provides the ActiveRecord method\nsignatures read_attribute(key) and write_attribute(key,val),\nand simple record finder signatures find(id) and find(:all).\n\nThis provides some of the ActiveRecord method signatures we use:\n\n  * read_attribute(key)\n  * write_attribute(key,val)\n  * find(id)\n  * find(:all)\n\nFor docs go to \u003chttp://sixarm.com/sixarm_ruby_active_record_mock/doc\u003e\n\nWant to help? We're happy to get pull requests.\n\n\n\u003c!--install-open--\u003e\n\n## Install\n\n### Gem\n\nTo install this gem in your shell or terminal:\n\n    gem install sixarm_ruby_active_record_mock\n\n### Gemfile\n\nTo add this gem to your Gemfile:\n\n    gem 'sixarm_ruby_active_record_mock'\n\n### Require\n\nTo require the gem in your code:\n\n    require 'sixarm_ruby_active_record_mock'\n\n\u003c!--install-shut--\u003e\n\n\n## Examples\n\nBasic:\n\n    require \"sixarm_ruby_active_record_mock\"\n    mock = ActiveRecordMock.new\n    mock.write_attribute('foo','bar')\n    mock.read_attribute('foo') =\u003e 'bar'\n\nInitialize with attributes:\n\n    mock = ActiveRecordMock.new(:foo =\u003e 'bar', :goo =\u003e 'car', :hoo =\u003e 'dar')\n    mock.read_attribute(:foo') =\u003e 'bar'\n    mock.read_attribute(:goo') =\u003e 'car'\n    mock.read_attribute(:hoo') =\u003e 'dar'\n\nCreating mock users:\n\n    anne = ActiveRecordMock.new(:id =\u003e 123, :name =\u003e 'Anne')\n    beth = ActiveRecordMock.new(:id =\u003e 456, :name =\u003e 'Beth')\n    cate = ActiveRecordMock.new(:id =\u003e 789, :name =\u003e 'Cate')\n\nMock finder creation:\n\n    ActiveRecordMock.find=[anne,beth,cate]\n\nMock finder retrieval of records by id:\n\n    ActiveRecordMock.find(123) =\u003e anne\n    ActiveRecordMock.find(456) =\u003e beth\n    ActiveRecordMock.find(789) =\u003e cate\n\nMock finder retrieval of all records:\n\n    ActiveRecordMock.find(:all) =\u003e [anne,beth,cate]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsixarm%2Fsixarm_ruby_active_record_mock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsixarm%2Fsixarm_ruby_active_record_mock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsixarm%2Fsixarm_ruby_active_record_mock/lists"}