{"action":"closed","issue":{"url":"https://api.github.com/repos/joelhelbling/squares/issues/1","labels_url":"https://api.github.com/repos/joelhelbling/squares/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/joelhelbling/squares/issues/1/comments","events_url":"https://api.github.com/repos/joelhelbling/squares/issues/1/events","html_url":"https://github.com/joelhelbling/squares/issues/1","id":52798100,"number":1,"title":"default with a callback","user":{"login":"joelhelbling","id":6198,"avatar_url":"https://avatars.githubusercontent.com/u/6198?v=3","gravatar_id":"","url":"https://api.github.com/users/joelhelbling","html_url":"https://github.com/joelhelbling","followers_url":"https://api.github.com/users/joelhelbling/followers","following_url":"https://api.github.com/users/joelhelbling/following{/other_user}","gists_url":"https://api.github.com/users/joelhelbling/gists{/gist_id}","starred_url":"https://api.github.com/users/joelhelbling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joelhelbling/subscriptions","organizations_url":"https://api.github.com/users/joelhelbling/orgs","repos_url":"https://api.github.com/users/joelhelbling/repos","events_url":"https://api.github.com/users/joelhelbling/events{/privacy}","received_events_url":"https://api.github.com/users/joelhelbling/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/joelhelbling/squares/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/joelhelbling/squares/milestones/1","labels_url":"https://api.github.com/repos/joelhelbling/squares/milestones/1/labels","id":948964,"number":1,"title":"0.3.0","description":null,"creator":{"login":"joelhelbling","id":6198,"avatar_url":"https://avatars.githubusercontent.com/u/6198?v=3","gravatar_id":"","url":"https://api.github.com/users/joelhelbling","html_url":"https://github.com/joelhelbling","followers_url":"https://api.github.com/users/joelhelbling/followers","following_url":"https://api.github.com/users/joelhelbling/following{/other_user}","gists_url":"https://api.github.com/users/joelhelbling/gists{/gist_id}","starred_url":"https://api.github.com/users/joelhelbling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joelhelbling/subscriptions","organizations_url":"https://api.github.com/users/joelhelbling/orgs","repos_url":"https://api.github.com/users/joelhelbling/repos","events_url":"https://api.github.com/users/joelhelbling/events{/privacy}","received_events_url":"https://api.github.com/users/joelhelbling/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":5,"state":"open","created_at":"2015-01-23T19:23:19Z","updated_at":"2015-01-24T02:32:16Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2014-12-24T06:06:23Z","updated_at":"2015-01-24T02:32:16Z","closed_at":"2015-01-24T02:32:16Z","body":"When defining a property in a model (e.g. `property :wise_men, default: 3`) it would be nifty to be able to provide a callback which would be called at the time of item instantiation, i.e. `property :blind_mice, default: -> { Mice.where { |m| m.vision == 'impaired' }.count }`.\r\n\r\nThe callback could be anything that responds to #call.  When a model object is instantiated, all non-callback defaulted fields should be set first, followed by all callback defaults in the order in which they were defined in the model.\r\n\r\nObviously, these callback defaults would be called (as appropriate) _only_ for brand-new objects.  Objects pulled from the datastore would have had those defaults set when they were instantiated so they could be stored in the first place."}}