Skip to content

Commit

Permalink
expose default value on simple property
Browse files Browse the repository at this point in the history
needed for generating sorbet type specs with tapioca
  • Loading branch information
langalex committed Jan 2, 2023
1 parent eaa89f1 commit a185a80
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/couch_potato/persistence/simple_property.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ def load_attribute_from_document(name)
end

class SimpleProperty #:nodoc:
attr_accessor :name, :type
attr_accessor :name, :type, :default_value

def initialize(owner_clazz, name, options = {})
self.name = name
@setter_name = "#{name}="
self.type = options[:type]
self.default_value = options[:default]
@type_caster = TypeCaster.new
owner_clazz.send :include, PropertyMethods unless owner_clazz.ancestors.include?(PropertyMethods)

Expand Down

0 comments on commit a185a80

Please sign in to comment.