Sha256: 1f51cf3b53c58039378fe99331afe6f5df8089cade5d550165315ef5ed8ef76d
Contents?: true
Size: 734 Bytes
Versions: 21
Compression:
Stored size: 734 Bytes
Contents
# frozen_string_literal: true # PaidUp module module PaidUp # Feature Setting Type Class: Not an ActiveRecord object. class FeatureSettingType include ActiveModel::Model include ActiveModel::AttributeMethods attr_accessor :name, :user delegate :plan, to: :user def rows_unlimited? rows_allowed == PaidUp::Unlimited.to_i end def rows_remaining rows_allowed - rows_count end def rows_allowed plan.feature_setting name end def rows scope.where(user: user) end def ids rows.ids end def rows_count rows.size end def model name.classify.constantize end def scope model.paid_for_scope end end end
Version data entries
21 entries across 21 versions & 1 rubygems