{": rooto:"YARD::CodeObjects::RootObject:@childrenIC:&YARD::CodeObjects::CodeObjectList[o:$YARD::CodeObjects::ModuleObject;IC;[ o:+YARD::CodeObjects::ClassVariableObject: @files[["lib/record_history.rbi :@current_file_has_commentsF: @name: @@config:@source_type: ruby:@visibility: public: @tags[:@docstringIC:YARD::Docstring" :EF: @object@ : @summary0:@hash_flagF:@ref_tags[;[: @allI";F:@docstring_extra0:@docstring_extra_tags0:@namespace@: @pathI"RecordHistory::@@config;F:@signature"@@config = {}: @source"@@config = {}: @value"{}: @dynamicTo:$YARD::CodeObjects::MethodObject: @scope: class;;;I"RecordHistory.author=;F:@parameters[[" value0; [[@ i; F; : author=;;;[;IC;" ;F;@;0;F;[;[;I";F;0;0;@;!":def self.author=(value) config[:author] = value end; I"def author=(.);F:@explicitT;#To;$;%;&;;;I"RecordHistory.author;F;'[; [[@ i; F; : author;;;[;IC;" ;F;@%;0;F;[;[;I";F;0;0;@;!"*def self.author config[:author] end; I"def author(.);F;)T;#To;$;%;&;: private;I"RecordHistory.config;F;'[; [[@ i; F; : config;;;[;IC;" ;F;@1;0;F;[;[;I";F;0;0;@;!"#def self.config @@config end; I"def config(.);F;)T;#To:&YARD::CodeObjects::ConstantObject; [[""lib/record_history/version.rbi; F; : VERSION;;;;;[;IC;" ;F;@=;0;F;[;[;I";F;0;0;@;I"RecordHistory::VERSION;F; "VERSION = "0.0.2";!"VERSION = "0.0.2";"" "0.0.2";#To; ;IC;[o;$;%;&;;;I"'RecordHistory::Controller.included;F;'[[" base0; [["%lib/record_history/controller.rbi; F; : included;;;[;IC;" ;F;@L;0;F;[;[o:YARD::Tags::Tag :@tag_nameI" private;F: @text0; 0: @types0;@L;I";F;0;0;@J;!"Pdef self.included(base) base.before_filter :set_record_history_author end; I"def included(.);F;)T;#To;$;%: instance;:protected;I"8RecordHistory::Controller#author_for_record_history;F;'[; [[@Si; F; :author_for_record_history;;;[;IC;" ;F;@];0;F;[;[;I";F;0;0;@J;!"@def author_for_record_history current_user rescue nil end; I"%def author_for_record_history( );F;)T;#To;$;%;4;;5;I"8RecordHistory::Controller#set_record_history_author;F;'[; [[@Si; F; :set_record_history_author;;;[;IC;" ;F;@i;0;F;[;[;I";F;0;0;@J;!"Vdef set_record_history_author ::RecordHistory.author = user_for_paper_trail end; I"%def set_record_history_author( );F;)T;#T: @owner@J:@class_mixinsIC;[;8@J:@instance_mixinsIC;[;8@J:@attributesIC:SymbolHash{;&IC;<{:@symbolize_valueT;4IC;<{;=T;=T: @aliases{: @groups[; [[@Si; F; :Controller;;;;;[;IC;" ;F;@J;0;F;[;[;I";F;0;0;@;I"RecordHistory::Controller;F;#To; ;IC;[o;$;%;&;;;I""RecordHistory::Model.included;F;'[[" base0; [["-lib/record_history/has_record_history.rbi ; F; ;/;;;[;IC;" ;F;@;0;F;[;[o;0 ;1I" private;F;20; 0;30;@;I";F;0;0;@;!"Bdef self.included(base) base.send :extend, ClassMethods end; I"def included(.);F;)T;#To; ;IC;[o;$;%;4;;;I":RecordHistory::Model::ClassMethods#has_record_history;F;'[[" options"{}; [[@i; F; :has_record_history;;;[;IC;" ;F;@;0;F;[;[;I";F;0;0;@;!"wdef has_record_history(options={}) send :include, InstanceMethods attr_accessor :record_history_obj class_attribute :record_history_ignore self.record_history_ignore = ([options[:ignore]].flatten.compact || []).map{|attr| attr.to_s} class_attribute :record_history_only self.record_history_only = ([options[:only]].flatten.compact || []).map{|attr| attr.to_s} has_many :record_history, :class_name => 'RecordHistoryModel', :order => "created_at DESC", :as => :item before_save :build_record_history_obj after_save :save_record_history_obj end; I"'def has_record_history(options={});F;)T;#To;$;%;4;;;I"@RecordHistory::Model::ClassMethods#is_record_history_author;F;'[[" options"{}; [[@i"; F; :is_record_history_author;;;[;IC;" ;F;@;0;F;[;[;I";F;0;0;@;!"def is_record_history_author(options={}) has_many :history, :class_name => 'RecordHistoryModel', :order => "created_at DESC", :as => :author end; I"-def is_record_history_author(options={});F;)T;#T;8@;9IC;[;8@;:IC;[;8@;;IC;<{;&IC;<{;=T;4IC;<{;=T;=T;>{;?[; [[@i ; F; :ClassMethods;;;;;[;IC;" ;F;@;0;F;[;[;I";F;0;0;@;I"'RecordHistory::Model::ClassMethods;F;#To; ;IC;[o;$;%;4;;;I"CRecordHistory::Model::InstanceMethods#build_record_history_obj;F;'[; [[@i-; F; :build_record_history_obj;;;[;IC;" ;F;@;0;F;[;[;I";F;0;0;@;!"def build_record_history_obj self.record_history_obj ||= [] self.class.new.attributes.keys.each do |attr_name| if (self.send("#{attr_name}_changed?")) next if self.class.record_history_only && !self.class.record_history_only.include?(attr_name) next if self.class.record_history_ignore && self.record_history_ignore.include?(attr_name) self.record_history_obj << RecordHistoryModel.new( :item_type => self.class.name, :item_id => self.id, :attr_name => attr_name, :old_value => self.send("#{attr_name}_was"), :new_value => self.send("#{attr_name}"), :author => RecordHistory.author ) end end end; I"$def build_record_history_obj( );F;)T;#To;$;%;4;;;I"BRecordHistory::Model::InstanceMethods#save_record_history_obj;F;'[; [[@i?; F; :save_record_history_obj;;;[;IC;" ;F;@;0;F;[;[;I";F;0;0;@;!"Xdef save_record_history_obj self.record_history_obj.each{|item| item.save} end; I"#def save_record_history_obj( );F;)T;#T;8@;9IC;[;8@;:IC;[;8@;;IC;<{;&IC;<{;=T;4IC;<{;=T;=T;>{;?[; [[@i*; F; :InstanceMethods;;;;;[;IC;" ;F;@;0;F;[;[;I";F;0;0;@;I"*RecordHistory::Model::InstanceMethods;F;#T;8@;9IC;[;8@;:IC;[;8@;;IC;<{;&IC;<{;=T;4IC;<{;=T;=T;>{;?[; [[@i; F; : Model;;;;;[;IC;" ;F;@;0;F;[;[;I";F;0;0;@;I"RecordHistory::Model;F;#To:#YARD::CodeObjects::ClassObject;IC;[o;$;%;4;;;I":RecordHistory::InstallGenerator#create_migration_file;F;'[; [["7lib/generators/record_history/install_generator.rbi; F; :create_migration_file;;;[;IC;" ;F;@;0;F;[;[;I";F;0;0;@;!"}def create_migration_file migration_template 'create_record_histories.rb', 'db/migrate/create_record_histories.rb' end; I"!def create_migration_file( );F;)T;#T;8@;9IC;[o:YARD::CodeObjects::Proxy : @imethod0:@origname"(ActiveRecord::Generators::Migration:@orignamespace@; :Migration;o;J ;K0;L"ActiveRecord::Generators;M@; :Generators;o;J ;K0;L0;M0; :ActiveRecord;@: @obj0;Q0;Q0;8@;:IC;[o;J ;K0;L"!Rails::Generators::Migration;M@; ;N;o;J ;K0;L"Rails::Generators;M@; ;O;o;J ;K0;L0;M0; : Rails;@;Q0;Q0;Q0;8@;;IC;<{;&IC;<{;=T;4IC;<{;=T;=T;>{;?[; [[@i ; F; :InstallGenerator;;;;;[;IC;" ;F;@;0;F;[;[;I";F;0;0;@;I"$RecordHistory::InstallGenerator;F:@superclasso;J ;K0;L"Rails::Generators::Base;M@; : Base;o;J ;K0;L"Rails::Generators;M@; ;O;o;J ;K0;L0;M0; ;R;@;Q0;Q0;Q0;#T;8@;9IC;[;8@;:IC;[;8@;;IC;<{;&IC;<{;=T;4IC;<{;=T;=T;>{;?[; [ [@ i [@@i[@Si[@i[@i ; F; :RecordHistory;;;;;[;IC;" ;F;@;0;F;[;[;I";F;0;0;@;I"RecordHistory;Fo;H;IC;[ o;$;%;4;;;I"!RecordHistoryModel#old_value;F;'[; [["/lib/record_history/record_history_model.rbi; F; :old_value;;;[;IC;" ;F;@;;0;F;[;[;I";F;0;0;@9;!"def old_value self.old_value = nil if self.old_value_dump.nil? self.old_value_dump.nil? ? nil : Marshal.load(self.old_value_dump) end; I"def old_value( );F;)T;#To;$;%;4;;;I""RecordHistoryModel#old_value=;F;'[[" value0; [[@@i; F; :old_value=;;;[;IC;" ;F;@H;0;F;[;[;I";F;0;0;@9;!"Idef old_value=(value) self.old_value_dump = Marshal.dump(value) end; I"def old_value=(value);F;)T;#To;$;%;4;;;I"!RecordHistoryModel#new_value;F;'[; [[@@i; F; :new_value;;;[;IC;" ;F;@V;0;F;[;[;I";F;0;0;@9;!"kdef new_value self.new_value = nil if self.new_value_dump.nil? Marshal.load(self.new_value_dump) end; I"def new_value( );F;)T;#To;$;%;4;;;I""RecordHistoryModel#new_value=;F;'[[" value0; [[@@i; F; :new_value=;;;[;IC;" ;F;@b;0;F;[;[;I";F;0;0;@9;!"Idef new_value=(value) self.new_value_dump = Marshal.dump(value) end; I"def new_value=(value);F;)T;#T;8@9;9IC;[;8@9;:IC;[;8@9;;IC;<{;&IC;<{;=T;4IC;<{;=T;=T;>{;?[; [[@@i; F; :RecordHistoryModel;;;;;[;IC;" ;F;@9;0;F;[;[;I";F;0;0;@;I"RecordHistoryModel;F;To;J ;K0;L"ActiveRecord::Base;M@; ;U;o;J ;K0;L0;M0; ;P;@;Q0;Q0o;H;IC;[o;$;%;&;;;I"CreateRecordHistories.up;F;'[; [["Glib/generators/record_history/templates/create_record_histories.rbi; F; :up;;;[;IC;" ;F;@;0;F;[;[;I";F;0;0;@;!"'def self.up create_table :record_histories do |t| t.string :item_type, :null => false t.integer :item_id, :null => false t.string :attr_name, :null => false t.text :old_value_dump, :null => false t.text :new_value_dump, :null => false t.string :author_type t.integer :author_id t.datetime :created_at end add_index :record_histories, [:item_type, :item_id, :attr_name] add_index :record_histories, [:item_type, :item_id] add_index :record_histories, [:author_type, :author_id] end; I"def up(.);F;)T;#To;$;%;&;;;I"CreateRecordHistories.down;F;'[; [[@i; F; : down;;;[;IC;" ;F;@;0;F;[;[;I";F;0;0;@;!"5def self.down drop_table :record_histories end; I"def down(.);F;)T;#T;8@;9IC;[;8@;:IC;[;8@;;IC;<{;&IC;<{;=T;4IC;<{;=T;=T;>{;?[; [[@i; F; :CreateRecordHistories;;;;;[;IC;" ;F;@;0;F;[;[;I";F;0;0;@;I"CreateRecordHistories;F;To;J ;K0;L"ActiveRecord::Migration;M@; ;N;o;J ;K0;L0;M0; ;P;@;Q0;Q0;8@;9IC;[;8@;:IC;[;8@;;IC;<{;&IC;<{;=T;4IC;<{;=T;=T;>{;?[; [; F; ;;;;;;[;IC;" ;F;@;0;F;[;[;I";F;0;0;0;I";F;V@:RecordHistory::@@config@ :RecordHistory.author=@:RecordHistory.author@%:RecordHistory.config@1:RecordHistory::VERSION@=:RecordHistory::Controller@J:'RecordHistory::Controller.included@L:8RecordHistory::Controller#author_for_record_history@]:8RecordHistory::Controller#set_record_history_author@i:RecordHistory::Model@:"RecordHistory::Model.included@:'RecordHistory::Model::ClassMethods@::RecordHistory::Model::ClassMethods#has_record_history@:@RecordHistory::Model::ClassMethods#is_record_history_author@:*RecordHistory::Model::InstanceMethods@:CRecordHistory::Model::InstanceMethods#build_record_history_obj@:BRecordHistory::Model::InstanceMethods#save_record_history_obj@;[@9:!RecordHistoryModel#old_value@;:"RecordHistoryModel#old_value=@H:!RecordHistoryModel#new_value@V:"RecordHistoryModel#new_value=@b:$RecordHistory::InstallGenerator@::RecordHistory::InstallGenerator#create_migration_file@;^@:CreateRecordHistories.up@:CreateRecordHistories.down@