Skip to content

Instantly share code, notes, and snippets.

View cableray's full-sized avatar

Garrett cableray

View GitHub Profile
const defaultSnapshot = {
token: '',
myInnerInfo: { login: '', type: '' },
myDisplayInfo: { login: '', type: '' },
loginInfo: { login: '', type: '' },
loginList: [],
loading: false,
logined: false,
}
@cableray
cableray / apple_record.rb
Last active July 8, 2017 19:05 — forked from sj26/apple_record.rb
How to do STI without separate controller per child: Utilize descendent tracking and override model_name so they use the same URL helpers and parameters as their base class. Makes things like responders and form_for work as expected, while preserving things like to_partial_path.
class AppleRecord < Record
end
module CheetahCub
class Transaction
attr_reader :transaction_delegate
delegate :save, to: :transaction_delegate
# def save
# transaction_delegate.save
# end
def initialize
@transaction_delegate = Config.module_prefix::Transaction.new
end