Skip to content
View tjbarker's full-sized avatar
Block or Report

Block or report tjbarker

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 100 characters, markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse

Pinned

  1. active admin, polymorphic drop down active admin, polymorphic drop down
    1
    # this is a helper method to provide setters for polymorphic relationships in active admin forms
    2
    # attribute_name: name that record knows polymorphic relationship as
    3
    # actions: the active record actions that should use this setter, defaults to setter being implemented before create and update
    4
    def polymorphic_attribute_set(attribute_name, actions: [:before_create, :before_update])
    5
      klass = config.resource_class
  2. Arel Cheatsheet Arel Cheatsheet
    1
    content copied from [Advanced Arel: When ActiveRecord Just Isn't Enough](https://www.youtube.com/watch?v=ShPAxNcLm3o)
    2
    
    
    3
    further information:
    4
    - [arel_cheatsheet_on_steroids](https://gist.github.com/ProGM/c6df08da14708dcc28b5ca325df37ceb)
    5
    - [Rails test examples](https://github.com/rails/rails/blob/main/activerecord/test/cases/arel/select_manager_test.rb)