Sha256: 6806e9dfbb7073497de5e74f5c8c3a3c71068683f8c58523fc1277b2347a4030
Contents?: true
Size: 560 Bytes
Versions: 13
Compression:
Stored size: 560 Bytes
Contents
module Saucy module Plan extend ActiveSupport::Concern included do has_many :accounts has_many :limits validates_presence_of :name end module InstanceMethods def free? price.zero? end def billed? !free? end def can_add_more?(limit, amount) limits.numbered.named(limit).value > amount end def allows?(limit) limits.boolean.named(limit).allowed? end def limit(limit_name) limits.named(limit_name) end end end end
Version data entries
13 entries across 13 versions & 1 rubygems