Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

annotate class_eval method for active resource schema attributes

  • Loading branch information...
commit 47670a5e03b58dd2a42bce8e616f448ff99f6f30 1 parent 527499c
Vijay Dev vijaydev authored fxn committed
Showing with 8 additions and 2 deletions.
  1. +8 −2 activeresource/lib/active_resource/schema.rb
10 activeresource/lib/active_resource/schema.rb
View
@@ -20,8 +20,8 @@ class Schema # :nodoc:
# end
#
# The schema stores the name and type of each attribute. That is then
- # read out by the schema method to populate the actual
- # Resource's schema
+ # read out by the schema method to populate the schema of the actual
+ # resource.
def initialize
@attrs = {}
end
@@ -40,6 +40,12 @@ def attribute(name, type, options = {})
# The following are the attribute types supported by Active Resource
# migrations.
KNOWN_ATTRIBUTE_TYPES.each do |attr_type|
+ # def string(*args)
+ # options = args.extract_options!
+ # attr_names = args
+ #
+ # attr_names.each { |name| attribute(name, 'string', options) }
+ # end
class_eval <<-EOV, __FILE__, __LINE__ + 1
def #{attr_type.to_s}(*args)
options = args.extract_options!
Please sign in to comment.
Something went wrong with that request. Please try again.