Add time_as_boolean feature to your ruby classes
gem install act_as_time_as_booleanOr in your Gemfile:
gem 'act_as_time_as_boolean'class Item
include ActAsTimeAsBoolean
attr_accessor :active_at
time_as_boolean :active, opposite: :inactive
end
item = Item.new
p item.active?
#=> false
p item.inactive?
#=> true
item.active = true
p item.active?
#=> true
p item.inactive?
#=> false- Fork repository
- Create a branch following a successfull branching model
- Write your feature/fix
- Write tests
- Pull request
Released under the MIT License. See the LICENSE file for further details.




