Sha256: bf3328d66546bda768ef384d3efea158062a050a20dd13691ea6a16ad29d1247

Contents?: true

Size: 370 Bytes

Versions: 2

Compression:

Stored size: 370 Bytes

Contents

# Assigns an additional instance variable for +@model+ named after the model's table name (e.g. @comment).
module Trailblazer::Operation::Controller::ActiveRecord
private
  def setup_operation_instance_variables!
    super
    instance_variable_set(:"@#{operation_model_name}", @model)
  end

  def operation_model_name
    @model.class.table_name.singularize
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
trailblazer-0.2.2 lib/trailblazer/operation/controller/active_record.rb
trailblazer-0.2.1 lib/trailblazer/operation/controller/active_record.rb