Sha256: 1517ce1c3a6d664f64b8495acb8655bd00fd271bdad774187802fbc1ba73e8d8

Contents?: true

Size: 239 Bytes

Versions: 10

Compression:

Stored size: 239 Bytes

Contents

class RollingMembershipType < MembershipType
  validates :duration, :presence => true

  def starts_at
    DateTime.now
  end

  def ends_at
    self.duration.nil? ? nil : DateTime.now + (self.duration.send(self.period.downcase))
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
artfully_ose-1.2.0 app/models/rolling_membership_type.rb
artfully_ose-1.2.0.beta.1 app/models/rolling_membership_type.rb
artfully_ose-1.2.0.alpha.2 app/models/rolling_membership_type.rb
artfully_ose-1.2.0.alpha.1 app/models/rolling_membership_type.rb
artfully_ose-1.2.0.pre.27 app/models/rolling_membership_type.rb
artfully_ose-1.2.0.pre.26 app/models/rolling_membership_type.rb
artfully_ose-1.2.0.pre.24 app/models/rolling_membership_type.rb
artfully_ose-1.2.0.pre.23 app/models/rolling_membership_type.rb
artfully_ose-1.2.0.pre.21 app/models/rolling_membership_type.rb
artfully_ose-1.2.0.pre.20 app/models/rolling_membership_type.rb