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

obviously

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

obviously

  • 0.2.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Donate to charity: water via Gittip

obviously

Guess obvious association class names in ActiveRecord.

Makes using namespaced model names, like Project::Discussion, much less painful.

Installation

Add this to your Gemfile:

gem 'obviously'

Usage

Notice the lack of class_name: 'User::Membership' style options in the associations. Works with belongs_to, has_one and has_many:

class Project < ActiveRecord::Base
    class Attachment < ActiveRecord::Base
        belongs_to :discussion
            # class_name: 'Project::Discussion'
    end

    class Discussion < ActiveRecord::Base
        belongs_to :project

        has_many :attachments
            # class_name: 'Project::Attachment'
    end

    has_many :discussions
        # class_name: 'Project::Discussion'

    has_many :attachments,
        through: :discussions
        # class_name: 'Project::Attachment'
end

FAQs

Package last updated on 27 Apr 2014

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