Sha256: 9783ecd3da5e1986494aef94b797ce2162b78969da391f26926108fa165767dd

Contents?: true

Size: 1.16 KB

Versions: 3

Compression:

Stored size: 1.16 KB

Contents

package <%= base_package %>.models.domain {
<% if has_manies.length > 0 -%>
	import org.restfulx.models.ModelsCollection;
<% end -%>
	import org.restfulx.models.RxModel;
  
	[Resource(name="<%= resource_controller_name %>")]
	[Bindable]
	public class <%= class_name %> extends RxModel {
<% if attributes && !attributes.empty? && attributes[0].flex_type != "Boolean" -%>
    	public static const LABEL:String = "<%= attributes[0].flex_name %>";
<% else -%>
    	public static const LABEL:String = "id";
<% end -%>

<% for attribute in attributes -%>
<% if attribute.type == :datetime || attribute.type == :time -%>
    	[DateTime]
<% end -%>
    	public var <%= attribute.flex_name %>:<%= attribute.flex_type %>;

<% end -%>
<% for model in belongs_tos -%>
    	[BelongsTo]
    	public var <%= model.camelcase(:lower) %>:<%= model.camelcase %>;

<% end -%>
<% for model in has_ones -%>
    	[HasOne]
    	public var <%= model.camelcase(:lower) %>:<%= model.camelcase %>;
    
<% end -%>
<% for model in has_manies -%>
    	[HasMany]
    	public var <%= model.camelcase(:lower) %>:ModelsCollection;
    
<% end -%>
    	public function <%= class_name %>() {
    		super(LABEL);
    	}
	}
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
emergent-core-0.1.0 rails_generators/emergent_scaffold/templates/model.as.erb
emergent-core-0.1.02 rails_generators/emergent_scaffold/templates/model.as.erb
emergent-core-0.1.01 rails_generators/emergent_scaffold/templates/model.as.erb