Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Change method visibility on const_missing to be public

* Usually my convention when subclassing is to use the same visibility on any
  methods I'm overriding. Since all objects in Ruby inherit from Object, and
  Object#const_missing is public, then my own #const_missing methods should also
  be public.
  • Loading branch information...
commit f516036186541cb5a9da6ad02aafbaf92ca25e79 1 parent 14246fb
@dkubb dkubb authored
Showing with 9 additions and 12 deletions.
  1. +9 −9 lib/dm-core/model.rb
  2. +0 −3  lib/dm-core/property/lookup.rb
View
18 lib/dm-core/model.rb
@@ -710,15 +710,6 @@ def repositories
[ repository ].to_set + @properties.keys.map { |repository_name| DataMapper.repository(repository_name) }
end
- private
-
- # @api private
- def _create(attributes, execute_hooks = true)
- resource = new(attributes)
- resource.__send__(execute_hooks ? :save : :save!)
- resource
- end
-
# @api private
def const_missing(name)
if name == :DM
@@ -730,6 +721,15 @@ def const_missing(name)
end
end
+ private
+
+ # @api private
+ def _create(attributes, execute_hooks = true)
+ resource = new(attributes)
+ resource.__send__(execute_hooks ? :save : :save!)
+ resource
+ end
+
# @api private
def default_storage_name
base_model.name
View
3  lib/dm-core/property/lookup.rb
@@ -2,9 +2,6 @@ module DataMapper
class Property
module Lookup
- protected
-
- #
# Provides transparent access to the Properties defined in
# {Property}.
#
Please sign in to comment.
Something went wrong with that request. Please try again.