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

set_from

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

set_from

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

set_from

Example

class School < ActiveRecord::Base
  has_many :teachers
  has_many :courses
end

class Teacher < ActiveRecord::Base
  belongs_to :school
  has_many :courses
end

class Course < ActiveRecord::Base
  belongs_to :teacher
  belongs_to :school
  set_from :teacher, targets: [:school_id], update_for_change: true
end

school = School.create
teacher = Teacher.create(school: school)
course = teacher.courses.create
course.school_id # => school.id

FAQs

Package last updated on 06 Sep 2016

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