0.0
No release in over 3 years
Low commit activity in last 3 years
`must_be_ordered` gem is to warn or raise error if `order` is not set to ActiveRecord's Relation.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.16
~> 10.0
~> 3.0

Runtime

 Project Readme

MustBeOrdered

Build Status

must_be_ordered gem is to warn or raise error if order is not set to ActiveRecord's Relation.

Installation

Add this line to your application's Gemfile:

gem 'must_be_ordered'

And then execute:

$ bundle

Usage

Configuration:

# config/initializers/must_be_ordered.rb
MustBeOrdered.enabled = !Rails.env.production?

# choose action you need
MustBeOrdered.raise = true
MustBeOrdered.must_be_ordered_logger = true
MustBeOrdered.rails_logger = true

Models:

class Item < ActoveRecord::Base
  must_be_ordered
end

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/pi-chan/must_be_ordered.

License

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