
Security News
Oxlint Introduces Type-Aware Linting Preview
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.
It is a minimal base class that acts like an ActiveRecord without a matching database table. It has basic methods to support polymorhic association. Nothing special here :)
Add this line to your application's Gemfile:
gem 'mock_record'
And then execute:
$ bundle
Or install it yourself as:
$ gem install mock_record
Inherit the MockRecord::Base
class
class Square < MockRecord::Base
end
Assuming you have a polymorhic association
class Poly < ApplicationRecord
belongs_to :subject, polymorphic: true
end
then you can now use our Square
as a the subject of Poly
Poly.create(subject: Square.new)
This will create a Poly with subject_id
of 0
and subject_type
of Square
It is the same as
Poly.create(subject_id: 0, subject_type: "Square")
Bug reports and pull requests are welcome on GitHub at https://github.com/neume/mock_record. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that mock_record demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.