Skip to content

Releases: Purple-Magic/tramway

0.4.9.2

19 Nov 12:20
Compare
Choose a tag to compare

What's Changed

Full Changelog: 0.4.9.1...0.4.9.2

0.4.9.1

11 Sep 13:02
Compare
Choose a tag to compare

Full Changelog: 0.4.9...0.4.9.1

0.4.9

11 Sep 12:56
Compare
Choose a tag to compare

The discussion

Author:

Code review:

What's changed basically?

Added multiselect tailwind-styled input for tramway_form_for

What's changed for tramway drivers?

In case you want to use tailwind-styled multiselect this way

= tramway_form_for @user do |f|
  = f.multiselect :permissions, [['Create User', 'create_user'], ['Update user', 'update_user']]
  #- ...

you should add Tramway Multiselect Stimulus controller to your application.

Example for importmap-rails config

config/importmap.rb

pin '@tramway/multiselect', to: 'tramway/multiselect_controller.js'

app/javascript/controllers/index.js

import { application } from "controllers/application"
import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading"
import { Multiselect } from "@tramway/multiselect" // importing Multiselect controller class
eagerLoadControllersFrom("controllers", application)

application.register('multiselect', Multiselect) // register Multiselect controller class as `multiselect` stimulus controller

What's Changed

Full Changelog: 0.4.8...0.4.9

0.4.8

08 Aug 17:46
Compare
Choose a tag to compare

Author:

What's changed basically?

  • tramway_decorate method is available inside Tramway Decorator class

What's changed for tramway drivers?

Before

class UserDecorator < Tramway::BaseDecorator
  def published_posts
    PostDecorator.decorate object.posts.published
  end
end

After

class UserDecorator < Tramway::BaseDecorator
  def published_posts
    tramway_decorate object.posts.published
  end
end

Full Changelog: 0.4.7...0.4.8

0.4.7

04 Jul 23:46
Compare
Choose a tag to compare

What's changed basically?

Added assign method to Tramway Form.

What's changed for tramway drivers?

Tramway Form provides assign method that allows to assign values without saving

class UsersController < ApplicationController
  def update
    @user = tramway_form User.new
    @user.assign params[:user] # assigns values to the form object
    @user.reload # restores previous values
  end
end

What's Changed

Full Changelog: 0.4.6...0.4.7

0.4.6

20 May 10:51
Compare
Choose a tag to compare

Author:

Code-review:

What's changed basically?

  • Decorating association using Tramway Decorator

What's changed for tramway drivers?

Decorate associations

Before

class UserDecorator  < Tramway::BaseDecorator
  def posts
    PostDecorator.decorate object.posts
  end
end

After

class UserDecorator < Tramway::BaseDecorator
  association :posts
end

user = tramway_decorate User.first
user.posts # => decorated collection of posts with PostDecorator

What's Changed

Full Changelog: 0.4.5.1...0.4.6

0.4.5.1

06 May 23:34
Compare
Choose a tag to compare

What's Changed

Full Changelog: 0.4.5...0.4.5.1

0.4.5

06 May 23:07
Compare
Choose a tag to compare

What's Changed

Full Changelog: 0.4.4...0.4.5

0.4.4

07 Apr 23:04
Compare
Choose a tag to compare

Author:

What's changed basically?

  • Changed method delegation policy.
  • Added behave_as_ar method from this issue

What's changed for tramway drivers?

Tramway Decorator and Tramway Form support behave_as_ar method. It allows to use update and destroy methods with decorated and form objects.

What's Changed

Full Changelog: 0.4.3...0.4.4

0.4.3

05 Mar 11:23
Compare
Choose a tag to compare

Author:

Code-review:

What's changed basically?

Delegated update and destroy methods to Tramway Decorator.

What's changed for tramway drivers?

Before

user = tramway_decorate User.first
user.object.destroy

After

user = tramway_decorate User.first
user.destroy

What's Changed

Full Changelog: 0.4.2.1...0.4.3