-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Given the following YAML code, ginny generates the following ruby code (with no default value for created_at):
---
name: Post
description: This is an example
modules: [App]
parent: ApplicationRecord
default_constructor: true
attrs:
- { name: id, type: String }
- { name: created_at, type: Time, default: "Time.now()" }
- { name: updated_at, type: Time }module App
# This is an example
class Post < ApplicationRecord
# @return [String]
attr_accessor :id
# @return [Time]
attr_accessor :created_at
# @return [Time]
attr_accessor :updated_at
# @param params [Hash]
# @return [self]
def self.create(params = {})
p = Post.new
p.id = params[:id]
p.created_at = params[:created_at]
p.updated_at = params[:updated_at]
return p
end
end
endMetadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working