No commit activity in last 3 years
No release in over 3 years
Store mixed numbers in an ActiveRecord model seamlessly with built-in validation.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

>= 4.1.10
 Project Readme

MixedNumber

Store mixed numbers in an ActiveRecord model seamlessly with built-in validation.

Installation

Add this line to your application's Gemfile:

gem 'mixed_number_rails'

And then execute:

$ bundle

Or install it yourself as:

$ gem install mixed_number_rails

Usage

rails_mixed_number is based on my general purpose mixed_number ruby gem. Go there for examples on using MixedNumber objects.

Hooking up with Rails

  1. Create a model with a string attribute
    ? rails g model Item amount:string
  2. Open the model file you just generated and add mixed_number_attribute with the name of your attribute
    class Item < ActiveRecord::Base
    	mixed_number_attribute :amount
    end
  3. Your attribute will now be a mixed number, with validation.

Contributing

  1. Fork it ( https://github.com/tpadjen/mixed_number_rails/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 a new Pull Request