Skip to content

Commit

Permalink
Remove redundant self
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Rice authored and Adam Rice committed Jul 27, 2016
1 parent 7bb1788 commit 6c545d0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions config/initializers/active_record_extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ def self.rails_admin(&block)
end

def rails_admin_default_object_label_method
self.new_record? ? "new #{self.class}" : "#{self.class} ##{id}"
new_record? ? "new #{self.class}" : "#{self.class} ##{id}"
end

def safe_send(value)
if self.has_attribute?(value)
if has_attribute?(value)
read_attribute(value)
else
send(value)
Expand Down
2 changes: 1 addition & 1 deletion lib/rails_admin/adapters/mongoid/extension.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def rails_admin(&block)
end

def rails_admin_default_object_label_method
self.new_record? ? "new #{self.class}" : "#{self.class} ##{id}"
new_record? ? "new #{self.class}" : "#{self.class} ##{id}"
end

def safe_send(value)
Expand Down
2 changes: 1 addition & 1 deletion lib/rails_admin/config/fields/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def virtual?
property = am && am.properties.detect { |p| p.name == f.values.first.to_sym }
type = property && property.type
else # <attribute|column>
am = (self.association? ? associated_model_config.abstract_model : abstract_model)
am = (association? ? associated_model_config.abstract_model : abstract_model)
table_name = am.table_name
column = f
property = am.properties.detect { |p| p.name == f.to_sym }
Expand Down

0 comments on commit 6c545d0

Please sign in to comment.