Class: ActivePreview::Preview

Inherits:
SimpleDelegator
  • Object
show all
Includes:
AssociationHelper, OverridePersistence
Defined in:
lib/active_preview/preview.rb

Constant Summary collapse

SINGULAR =

~ used in place of association names

%w(create_~ create_~! reload_~)
COLLECTION =
%w(~_id ~_id= ~<<)

Instance Method Summary collapse

Methods included from AssociationHelper

#association_from_key, #association_inverse, #associations, #class_of_association, #singular?

Methods included from OverridePersistence

#becomes, #becomes!, #decrement, #decrement!, #delete, #destroy, #destroy!, #destroyed?, #increment, #increment!, #new_record?, #persisted?, #reload, #save, #save!, #toggle, #toggle!, #touch, #update, #update!, #update_attribute, #update_attributes, #update_attributes!, #update_column, #update_columns

Constructor Details

#initialize(record) ⇒ Preview

Returns a new instance of Preview.



8
9
10
11
# File 'lib/active_preview/preview.rb', line 8

def initialize(record)
  redefine_associations(record)
  super(record)
end

Instance Method Details

#model_objectObject



13
14
15
# File 'lib/active_preview/preview.rb', line 13

def model_object
  __getobj__
end