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

jferris-sconnect

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jferris-sconnect

  • 0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

= Sconnect

Sconnect is an extension to ActiveRecord's named_scopes that allows you to combine scopes in more interesting and useful ways.

== Download

Github: http://github.com/jferris/sconnect/tree/master

== Examples

Given the following model:

class Post < ActiveRecord::Base named_scope :published, :conditions => { :published => true } named_scope :titled, :conditions => "title IS NOT NULL" named_scope :from_today, lambda { { :conditions => ['created_at >= ?', 1.day.ago] } } end

ActiveRecord provides scope chains:

All published posts with titles

Post.published.titled

All published posts from today

Post.published.from_today

Sconnect extends these scopes:

All posts that are either published or titled

Post.published.or.titled

All posts that are published but not created today

Post.published.not.from_today

All posts that are either published or untitled

Post.published.or.not.titled

All posts from today that are either published or titled

Post.published.or.titled.from_today

== Author

Sconnect was written by Joe Ferris.

FAQs

Package last updated on 11 Aug 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