Skip to content

Commit

Permalink
Motion Support give inflector support much more robust pluarlization;…
Browse files Browse the repository at this point in the history
… also camelcase support
  • Loading branch information
hookercookerman committed Jul 23, 2012
1 parent 3a21ddf commit ff0163c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 15 deletions.
4 changes: 3 additions & 1 deletion lib/remote_model.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require "remote_model/version"
require 'bubble-wrap'
require "motion_support/inflector"

Dir.glob(File.join(File.dirname(__FILE__), 'remote_model/*.rb')).each do |file|
BW.require file
end
end
4 changes: 2 additions & 2 deletions lib/remote_model/record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def find_all(params = {}, &block)
if json.class == Array
arr_rep = json
elsif json.class == Hash
plural_sym = self.pluralize.to_sym
plural_sym = self.pluralize.downcase.to_sym
if json.has_key? plural_sym
arr_rep = json[plural_sym]
end
Expand Down Expand Up @@ -73,4 +73,4 @@ def destroy(&block)
end
end
end
end
end
4 changes: 2 additions & 2 deletions lib/remote_model/remote_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def belongs_to(params = [])
end

def pluralize
self.to_s.downcase + "s"
self.to_s.pluralize
end

def method_missing(method, *args, &block)
Expand Down Expand Up @@ -215,4 +215,4 @@ def setter_klass(hash, symbol)
[klass, hash_symbol]
end
end
end
end
9 changes: 0 additions & 9 deletions lib/remote_model/string.rb

This file was deleted.

3 changes: 2 additions & 1 deletion remote_model.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ Gem::Specification.new do |s|
s.require_paths = ["lib"]

s.add_dependency "bubble-wrap"
s.add_dependency "motion_support"
s.add_development_dependency 'rake'
end
end

0 comments on commit ff0163c

Please sign in to comment.