Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Naming conflicts #21

Merged
merged 1 commit into from

2 participants

@RichGuk

Fixed some name conflicts any potential name conflicts on private methods with other libraries.

I discovered this as I had a conflict in ActiveModel::Dirty, method in question: define_attribute_methods.

@dkubb dkubb merged commit 126b0a3 into solnic:master
@dkubb
Collaborator

Thanks for this fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 10, 2011
  1. @RichGuk
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/virtus/class_methods.rb
View
8 lib/virtus/class_methods.rb
@@ -44,8 +44,8 @@ def self.extended(descendant)
# @api public
def attribute(name, type, options = {})
attribute = Attribute.determine_type(type).new(name, options)
- define_attribute_methods(attribute)
- add_attribute(attribute)
+ virtus_define_attribute_methods(attribute)
+ virtus_add_attribute(attribute)
self
end
@@ -98,7 +98,7 @@ def const_missing(name)
# @return [undefined]
#
# @api private
- def define_attribute_methods(attribute)
+ def virtus_define_attribute_methods(attribute)
attribute.define_reader_method(self)
attribute.define_writer_method(self)
include self::AttributeMethods
@@ -111,7 +111,7 @@ def define_attribute_methods(attribute)
# @return [undefined]
#
# @api private
- def add_attribute(attribute)
+ def virtus_add_attribute(attribute)
attributes << attribute
descendants.each { |descendant| descendant.attributes.reset }
end
Something went wrong with that request. Please try again.