This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ModelForm | |
extend ActiveSupport::Concern | |
included do | |
class_attribute :model_class | |
self.model_class = self.superclass | |
end | |
module ClassMethods | |
def model_name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ModelForm | |
extend ActiveSupport::Concern | |
included do | |
class_attribute :model_class | |
self.model_class = self.superclass | |
class_attribute :permitted_attrs | |
self.permitted_attrs = [] | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'warden/test/helpers' | |
# Usage: | |
# rspec: | |
# config.include Helpers::Controllers::Auth, type: :controller | |
# | |
module Helpers | |
module Controllers | |
module Auth | |
extend ActiveSupport::Concern |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
class DoubleLinkedList | |
include Enumerable | |
def initialize | |
@head_guard = { prev: nil } | |
@tail_guard = { prev: @head_guard, next: nil } | |
@head_guard[:next] = @tail_guard | |
end |