sinatra_resource 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.2
1
+ 0.4.3
@@ -415,7 +415,19 @@ module SinatraResource
415
415
  if proc
416
416
  proc.call(document)
417
417
  else
418
- document.send(attribute == :id ? :_id : attribute)
418
+ document[attribute == :id ? :_id : attribute]
419
+ # An alternate way is:
420
+ #
421
+ # document.send(attribute == :id ? :_id : attribute)
422
+ #
423
+ # This will work; however, it would be confusing to support
424
+ # properties backed by model methods here if we don't do it
425
+ # everywhere. And supporting it everywhere would be tricky.
426
+ #
427
+ # For example, the filtering code relies on using MongoDB to
428
+ # search the database. If we supported properties backed by model
429
+ # methods, filtering / searching would be more complicated and
430
+ # expensive.
419
431
  end
420
432
  end
421
433
 
@@ -410,16 +410,6 @@ module SinatraResource
410
410
  # Can it be done more quickly?
411
411
  end
412
412
 
413
- # Returns a typecasted +value+. (Uses +model+ and +key_string+ to
414
- # figure out how to typecast it.)
415
- #
416
- # @return [Object]
417
- def typecast(model, key_string, value)
418
- dummy = model.new
419
- dummy.send(:"#{key_string}=", value)
420
- dummy.send(:"#{key_string}")
421
- end
422
-
423
413
  end
424
414
 
425
415
  end
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{sinatra_resource}
8
- s.version = "0.4.2"
8
+ s.version = "0.4.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["David James"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra_resource
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - David James