44
55module ReactOnRailsPro
66 class LicenseValidator
7+ # Grace period: 1 month (in seconds)
8+ GRACE_PERIOD_SECONDS = 30 * 24 * 60 * 60
9+
710 class << self
811 # Validates the license and returns the license data
912 # Caches the result after first validation
@@ -45,8 +48,8 @@ def reset!
4548 # @return [Boolean] true if plan is not "paid"
4649 def evaluation?
4750 data = validated_license_data!
48- plan = data [ "plan" ]
49- plan != "paid"
51+ plan = data [ "plan" ] . to_s
52+ plan != "paid" && ! plan . start_with? ( "paid_" )
5053 end
5154
5255 # Returns remaining grace period days if license is expired but in grace period
@@ -61,9 +64,6 @@ def grace_days_remaining
6164
6265 private
6366
64- # Grace period: 1 month (in seconds)
65- GRACE_PERIOD_SECONDS = 30 * 24 * 60 * 60
66-
6767 # Validates the license data and raises if invalid
6868 # Logs info/errors and handles grace period logic
6969 # @param license [Hash] The decoded license data
@@ -160,10 +160,10 @@ def load_license_string
160160 config_path = Rails . root . join ( "config" , "react_on_rails_pro_license.key" )
161161 return File . read ( config_path ) . strip if config_path . exist?
162162
163- @validation_error = "No license found. Please set REACT_ON_RAILS_PRO_LICENSE environment variable " \
164- "or create #{ config_path } file. " \
165- "Get a FREE evaluation license at https://shakacode.com/react-on-rails-pro"
166- handle_invalid_license ( @validation_error )
163+ error_msg = "No license found. Please set REACT_ON_RAILS_PRO_LICENSE environment variable " \
164+ "or create #{ config_path } file. " \
165+ "Get a FREE evaluation license at https://shakacode.com/react-on-rails-pro"
166+ handle_invalid_license ( error_msg )
167167 end
168168
169169 def public_key
0 commit comments