forked from hashicorp/vault-rails
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix missing Dirty methods not being generated
- Loading branch information
1 parent
78acc92
commit b10fb95
Showing
4 changed files
with
28 additions
and
7 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
lib/vault/active_record/associations/join_dependency/join_part.rb
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Force ther original JoinPart to load | ||
require 'active_record/associations/join_dependency/join_part' | ||
|
||
module ActiveRecord | ||
module Associations | ||
class JoinDependency | ||
class JoinPart | ||
# Prevent virtual attributes from being included in JOIN sql queries. | ||
# This will work with both ActiveRecord 4 an 5 because in the original | ||
# implementation this methos is delegated to the base class - the model. | ||
def column_names | ||
column_names = base_klass.column_names | ||
|
||
if base_klass.methods.include? :persistable_attribute_names | ||
column_names = column_names & base_klass.persistable_attribute_names | ||
end | ||
|
||
column_names | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains 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
This file contains 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
This file contains 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