Sha256: cbcb54273232a539ffe253488e533da7d1ac505550ec5d8e100e53dcfe38ca99

Contents?: true

Size: 475 Bytes

Versions: 27

Compression:

Stored size: 475 Bytes

Contents

module Trailblazer
  class Rails::Form < SimpleDelegator
    def initialize(delegated, model_class)
      super(delegated)
      @model_class = model_class
    end

    def self.name
      # for whatever reason, validations climb up the inheritance tree and require _every_ class to have a name (4.1).
      "Reform::Form"
    end

    def model_name
      ::ActiveModel::Name.new(self, nil, @model_class.to_s.camelize)
    end

    def to_model
      self
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
trailblazer-rails-2.4.4 lib/trailblazer/rails/form.rb
trailblazer-rails-2.4.3 lib/trailblazer/rails/form.rb
trailblazer-rails-2.4.2 lib/trailblazer/rails/form.rb
trailblazer-rails-2.4.1 lib/trailblazer/rails/form.rb
trailblazer-rails-2.4.0 lib/trailblazer/rails/form.rb
trailblazer-rails-2.3.0 lib/trailblazer/rails/form.rb
trailblazer-rails-2.2.0 lib/trailblazer/rails/form.rb
trailblazer-rails-1.0.11 lib/trailblazer/rails/form.rb
trailblazer-rails-2.1.7 lib/trailblazer/rails/form.rb
trailblazer-rails-2.1.6 lib/trailblazer/rails/form.rb
trailblazer-rails-1.0.10 lib/trailblazer/rails/form.rb
trailblazer-rails-2.1.5 lib/trailblazer/rails/form.rb
trailblazer-rails-1.0.9 lib/trailblazer/rails/form.rb
trailblazer-rails-2.1.4 lib/trailblazer/rails/form.rb
trailblazer-rails-2.1.2 lib/trailblazer/rails/form.rb
trailblazer-rails-1.0.8 lib/trailblazer/rails/form.rb
trailblazer-rails-1.0.7 lib/trailblazer/rails/form.rb
trailblazer-rails-2.1.1 lib/trailblazer/rails/form.rb
trailblazer-rails-2.1.0 lib/trailblazer/rails/form.rb
trailblazer-rails-2.0.0 lib/trailblazer/rails/form.rb