
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Manage custom fields to a Mongoid document or a collection. This module is one of the core features we implemented in our custom CMS, named LocomotiveCMS. Basically, its aim is to provide to editors a way to manage extra fields to a Mongoid document through, for instance, a web UI.
The main goals:
has_many
relationshipclass Company
include CustomFields::Source
has_many :employees
custom_fields_for :employees
end
class Employee
include CustomFields::Target
field :name, String
belongs_to :company, inverse_of: :employees
end
company = Company.new
company.employees_custom_fields.build label: 'His/her position', name: 'position', type: 'string', required: true
company.save
company.employees.build name: 'Michael Scott', position: 'Regional manager'
another_company = Company.new
employee = another_company.employees.build
employee.position # Returns a `not defined method` error
IN PROGRESS
class Company
custom_fields_for_itself
end
company = Company.new
company.self_metadata_custom_fields.build label: 'Shipping Address', name: 'address', type: 'text'
company.save
company.self_metadata.address = '700 S Laflin, 60607 Chicago'
another_company = Company.new
other_company.self_metadata.address # Returns a `not defined method` error
Run rspec
or rake
.
Run COVERAGE=true rspec
or COVERAGE=true rake
.
Feel free to contact me at did at locomotivecms dot com.
Copyright (c) 2023 NoCoffee, released under the MIT License (MIT), see [MIT-LICENSE].
FAQs
Unknown package
We found that custom_fields 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
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.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.