Skip to content

Commit

Permalink
Remove unused conditions
Browse files Browse the repository at this point in the history
alpaca-tc committed Jun 11, 2023
1 parent 24a6005 commit 4603649
Showing 2 changed files with 2 additions and 15 deletions.
11 changes: 1 addition & 10 deletions lib/active_record_encryption/type.rb
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ class Type < ActiveRecord::Type::Value
delegate :user_input_in_time_zone, to: :subtype # for ActiveRecord::AttributeMethods::TimeZoneConversion::TimeZoneConverter

def initialize(
subtype: default_value,
subtype: ActiveRecord::Type.default_value,
encryption: ActiveRecordEncryption.default_encryption.clone,
**options
)
@@ -37,15 +37,6 @@ def changed_in_place?(raw_old_value, value)

attr_reader :subtype, :binary, :encryptor

# NOTE: `ActiveRecord::Type.default_value` is not defined in Rails 5.0
def default_value
if ActiveRecord.gem_version < Gem::Version.create('5.1.0')
ActiveRecord::Type::Value.new
else
ActiveRecord::Type.default_value
end
end

def build_encryptor(options)
encryptor = options.delete(:encryptor)

6 changes: 1 addition & 5 deletions spec/support/activerecord_model.rb
Original file line number Diff line number Diff line change
@@ -113,11 +113,7 @@

alias_attribute :title, :name

if ActiveRecord.gem_version >= Gem::Version.create('5.2.0')
attribute :cancel_save_from_callback
else
attr_accessor :cancel_save_from_callback
end
attribute :cancel_save_from_callback
end

table do |t|

0 comments on commit 4603649

Please sign in to comment.