We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bef8535 commit 796f8c5Copy full SHA for 796f8c5
1 file changed
lib/active_admin/mongoid/document.rb
@@ -27,16 +27,12 @@ def quote_column_name name
27
end
28
29
30
- # CLASS METHODS
31
-
32
included do
33
- unless respond_to? :primary_key
34
- class << self
35
- attr_accessor :primary_key
36
- end
+ unless respond_to?(:primary_key) && respond_to?(:primary_key=)
+ class_attribute :primary_key, instance_writer: false
37
38
39
- self.primary_key ||= :id
+ self.primary_key = :id if primary_key.nil?
40
41
def column_for_attribute(name)
42
self.class.fields[name.to_sym]
0 commit comments