Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mc_record

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mc_record

  • 0.1.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

McRecord

McRecord is an ORM for MicroCMS API like ActiveRecord written in Ruby.

https://document.microcms.io/content-api/get-list-contents

Usage

Configure MicroCMS API

Configure MicroCMS to use API. https://document.microcms.io/manual/create-api

Installation

Create a Gemfile like below, and bundle install.

gem "mc_record"

Implementation

Create a Ruby source file like below.

require "mc_record"

# Credentials
McRecord::Base.config(
  service_domain: "[Domain Name]",
  api_key: "[API Key]",
  end_point: "[End Point]"
)

# Define a class that inherits `McRecord::Base`
class Content < McRecord::Base
end

# Examples
content = Content.find("[ID]") # => Content

# MicroCMS API fields can be read/written as attributes of defined classes.
puts content.name
content.category = ""

# Other Methods.
Content.all # => Array<Content>
Content.where(category: "[Name of Category]") # => Array<Content>

Supported features

The following methods are supported.

  • all
  • find
  • where

Future Issues.

It looks like Active Record, but doesn't offer the complexities of Active Record::Relation. For example, it does not support method chaining, lazy loading, etc.

FAQs

Package last updated on 24 Jan 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc