Skip to content
This repository was archived by the owner on Oct 28, 2019. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/lucky_record/form.cr
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ abstract class LuckyRecord::Form(T)
▸ Use 'create' to create a brand new record.
▸ Use 'update' to update an existing record.

ERROR %}
ERROR
%}
end

macro add_fields(fields)
Expand Down Expand Up @@ -184,7 +185,8 @@ abstract class LuckyRecord::Form(T)

▸ fillable #{field_name.var}

ERROR %}
ERROR
%}
{% end %}
{% unless field_name.is_a?(SymbolLiteral) || field_name.is_a?(Call) %}
{% raise <<-ERROR
Expand All @@ -195,7 +197,8 @@ abstract class LuckyRecord::Form(T)
▸ Use a bare word (recommended): 'fillable name'
▸ Use a Symbol: 'fillable :name'

ERROR %}
ERROR
%}
{% end %}
{% if FIELDS.any? { |field| field[:name].id == field_name.id } %}
def {{ field_name.id }}
Expand All @@ -213,7 +216,8 @@ abstract class LuckyRecord::Form(T)
▸ Add the column to the model if it doesn't exist.
▸ Use 'virtual' if you want a field that is not saved to the database.

ERROR %}
ERROR
%}
{% end %}
{% end %}
end
Expand Down