lib/lotus/generators/model.rb in lotusrb-0.4.0 vs lib/lotus/generators/model.rb in lotusrb-0.4.1
- old
+ new
@@ -15,10 +15,12 @@
end
# @since 0.3.1
# @api private
def start
+ assert_model!
+
opts = {
model_name: @model_name
}
templates = {
@@ -72,9 +74,17 @@
# @since 0.4.0
# @api private
def name
Utils::String.new(app_name || super).underscore
+ end
+
+ # @since 0.4.1
+ # @api private
+ def assert_model!
+ if @model_name.nil? || @model_name.empty?
+ raise Lotus::Commands::Generate::Error.new("Missing model name")
+ end
end
end
end
end