All Projects â†’ brandonweiss â†’ Hold_please

brandonweiss / Hold_please

Licence: mit
📞 Disable ActiveRecord callbacks in Rails for great justice!

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Hold please

Zero downtime migrations
Zero downtime migrations with ActiveRecord 3+ and PostgreSQL
Stars: ✭ 513 (+2465%)
Mutual labels:  activerecord, rails
Unread
Handle unread records and mark them as read with Ruby on Rails
Stars: ✭ 638 (+3090%)
Mutual labels:  activerecord, rails
Activerecord Multi Tenant
Rails/ActiveRecord support for distributed multi-tenant databases like Postgres+Citus
Stars: ✭ 526 (+2530%)
Mutual labels:  activerecord, rails
Activerecord Jdbc Adapter
JRuby's ActiveRecord adapter using JDBC.
Stars: ✭ 457 (+2185%)
Mutual labels:  activerecord, rails
Activerecord Postgis Adapter
ActiveRecord connection adapter for PostGIS, based on postgresql and rgeo
Stars: ✭ 746 (+3630%)
Mutual labels:  activerecord, rails
Attribute normalizer
Adds the ability to normalize attributes cleanly with code blocks and predefined normalizers
Stars: ✭ 473 (+2265%)
Mutual labels:  activerecord, rails
Github Ds
A collection of Ruby libraries for working with SQL on top of ActiveRecord's connection
Stars: ✭ 597 (+2885%)
Mutual labels:  activerecord, rails
Deep pluck
Allow you to pluck attributes from nested associations without loading a bunch of records.
Stars: ✭ 385 (+1825%)
Mutual labels:  activerecord, rails
Paper trail
Track changes to your rails models
Stars: ✭ 6,185 (+30825%)
Mutual labels:  activerecord, rails
Rein
Database constraints made easy for ActiveRecord.
Stars: ✭ 657 (+3185%)
Mutual labels:  activerecord, rails
Strip attributes
🔪 An ActiveModel extension that automatically strips all attributes of leading and trailing whitespace before validation. If the attribute is blank, it strips the value to nil.
Stars: ✭ 441 (+2105%)
Mutual labels:  activerecord, rails
Datagrid
Gem to create tables grids with sortable columns and filters
Stars: ✭ 921 (+4505%)
Mutual labels:  activerecord, rails
Rails Pg Extras
Rails PostgreSQL database performance insights. Locks, index usage, buffer cache hit ratios, vacuum stats and more.
Stars: ✭ 432 (+2060%)
Mutual labels:  activerecord, rails
Order query
Find next / previous Active Record(s) in one query
Stars: ✭ 472 (+2260%)
Mutual labels:  activerecord, rails
Store model
Work with JSON-backed attributes as ActiveRecord-ish models
Stars: ✭ 410 (+1950%)
Mutual labels:  activerecord, rails
Stateful enum
A very simple state machine plugin built on top of ActiveRecord::Enum
Stars: ✭ 546 (+2630%)
Mutual labels:  activerecord, rails
Annotate models
Annotate Rails classes with schema and routes info
Stars: ✭ 3,849 (+19145%)
Mutual labels:  activerecord, rails
Second level cache
Write Through and Read Through caching library inspired by CacheMoney and cache_fu, support ActiveRecord 4, 5 and 6.
Stars: ✭ 380 (+1800%)
Mutual labels:  activerecord, rails
Mobility
Pluggable Ruby translation framework
Stars: ✭ 644 (+3120%)
Mutual labels:  activerecord, rails
Activerecordextended
Adds additional postgres functionality to an ActiveRecord / Rails application
Stars: ✭ 830 (+4050%)
Mutual labels:  activerecord, rails

Hold Please

Because ActiveRecord callbacks are a bad idea. They're way too easy to misuse and should probably be removed from Rails altogether. But, as some Rails core team members in favor of the removal have pointed out, that will probably never happen.

But that's no reason not to protect yourself and your loved ones.

class User < ActiveRecord::Base

  before_create do
    # Bad stuff
  end

end
>> User.create!
HoldPlease::NoCallbacks: You really shouldn't use ActiveRecord callbacks

Installation

Add the gem to your Gemfile.

gem "hold_please"

Usage

You don't have to do anything—just don't use ActiveRecord callbacks. If someone does, an exception will be raised letting them know they've done a bad thing. Callbacks used from within gems will continue to work as normal—an exception will only be raised if a callback is used from inside the app.

It should work on Rails versions 3.0.0 and up.

Credits

Lots of love to Gary Bernhardt and his gem Do Not Want for giving me the idea.

Also infinite thanks to Avand, as always, for brainstorming the perfect name with me and myriad other things.

Contributing

  1. Fork it ( http://github.com/brandonweiss/hold_please/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].