Skip to content

Commit

Permalink
In track_associations, only check db if no config
Browse files Browse the repository at this point in the history
This allows users who need to precompile assets without a database
to configure `track_associations = false`.

See discussion: #636
  • Loading branch information
jaredbeck committed Nov 1, 2015
1 parent 8402e1b commit 90dc72c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/paper_trail/config.rb
Expand Up @@ -32,7 +32,9 @@ def serialized_attributes=(value)
end

def track_associations
@track_associations ||= PaperTrail::VersionAssociation.table_exists?
@track_associations.nil? ?
PaperTrail::VersionAssociation.table_exists? :
@track_associations
end
alias_method :track_associations?, :track_associations

Expand Down

0 comments on commit 90dc72c

Please sign in to comment.