diff options
Diffstat (limited to 'railties/lib/rails/generators/active_model.rb')
-rw-r--r-- | railties/lib/rails/generators/active_model.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/railties/lib/rails/generators/active_model.rb b/railties/lib/rails/generators/active_model.rb index 6183944bb0..8df8eb2438 100644 --- a/railties/lib/rails/generators/active_model.rb +++ b/railties/lib/rails/generators/active_model.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Rails module Generators # ActiveModel is a class to be implemented by each ORM to allow Rails to @@ -39,13 +41,13 @@ module Rails # GET edit # PATCH/PUT update # DELETE destroy - def self.find(klass, params=nil) + def self.find(klass, params = nil) "#{klass}.find(#{params})" end # GET new # POST create - def self.build(klass, params=nil) + def self.build(klass, params = nil) if params "#{klass}.new(#{params})" else @@ -59,7 +61,7 @@ module Rails end # PATCH/PUT update - def update(params=nil) + def update(params = nil) "#{name}.update(#{params})" end |