Skip to content

Commit

Permalink
Drop support for ActiveSupport < 5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
pilaf committed Dec 22, 2023
1 parent 9d04385 commit 5c08b14
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
1 change: 1 addition & 0 deletions fmrest-spyke.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Gem::Specification.new do |spec|

spec.add_dependency "fmrest-core", "=#{FmRest::VERSION}"
spec.add_dependency "spyke", ">= 7.0"
spec.add_dependency "activesupport", ">= 5.2"

# NOTE: Add development deps to fmrest.gemspec
end
8 changes: 2 additions & 6 deletions lib/fmrest/spyke/model/associations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,8 @@ module Associations
# to parse the portalData JSON in SpykeFormatter
#
# TODO: Replace this with options in PortalBuilder
class_attribute :portal_options, instance_accessor: false, instance_predicate: false

# class_attribute supports a :default option since ActiveSupport 5.2,
# but we want to support previous versions too so we set the default
# manually instead
self.portal_options = {}.freeze
class_attribute :portal_options, instance_accessor: false, instance_predicate: false,
default: {}.freeze

class << self; private :portal_options=; end

Expand Down
8 changes: 2 additions & 6 deletions lib/fmrest/spyke/model/attributes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,8 @@ module Attributes

# Keep track of attribute mappings so we can get the FM field names
# for changed attributes
class_attribute :mapped_attributes, instance_writer: false, instance_predicate: false

# class_attribute supports a :default option since ActiveSupport 5.2,
# but we want to support previous versions too so we set the default
# manually instead
self.mapped_attributes = ::ActiveSupport::HashWithIndifferentAccess.new.freeze
class_attribute :mapped_attributes, instance_writer: false, instance_predicate: false,
default: ::ActiveSupport::HashWithIndifferentAccess.new.freeze

class << self; private :mapped_attributes=; end

Expand Down

0 comments on commit 5c08b14

Please sign in to comment.