Skip to content

Instantly share code, notes, and snippets.

@Schwad
Created February 19, 2018 14:48
Show Gist options
  • Save Schwad/bcdcf551f628a3f8bdd7e035dbf2a1a7 to your computer and use it in GitHub Desktop.
Save Schwad/bcdcf551f628a3f8bdd7e035dbf2a1a7 to your computer and use it in GitHub Desktop.
class AttributesApiExample < ApplicationRecord
attribute :start_date, :date, default: -> { 1.day.from_now }
attribute :end_date, :date, default: -> { 8.days.from_now }
attribute :my_attribute, :my_type, default: -> { 'My Default Value' }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment