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

shatter-rails

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shatter-rails

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Shatter

Shatter is a generator for Rails that seperates an existing model logic into separate files. Shatter uses ActiveSupport::Conern's included do end block to call code in the primary model file in the context of that model's class.

When to use Shatter?

  • Your models are getting too fat.
  • You don't want to break any existing code.
  • You want to stay compatible with 'The Rails Way'.

Installation

Add this line to your Rails application's Gemfile:

gem 'shatter-rails'

And then execute:

$ bundle
$ rails g shatter:shatter [model]

Usage

Description:
    Shatter is a generator for Rails that seperates an existing model logic into separate files. 

Example:
    rails generate shatter thing

    This will create:
        /app/models/thing/assocations.rb
        /app/models/thing/operations.rb
        /app/models/thing/queries.rb
        /app/models/thing/validations.rb

    And will insert the following into /app/models/thing.rb:
        include Thing::Associations
        include Thing::Operations
        include Thing::Queries
        include Thing::Validations

Once you've run the generator, you can copy and paste code from your thing.rb model file into the appropriate file.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/morochena/shatter.

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 21 May 2018

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