Skip to content

Commit

Permalink
todos
Browse files Browse the repository at this point in the history
  • Loading branch information
ahoward committed Jan 26, 2014
1 parent 9acca88 commit 68ef898
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions TODO.md
@@ -1,5 +1,9 @@
todo:

Model[id]
Model.select
Model.where

- reconsider using active_model...

- with ro, do we/should we need to expand assets?
Expand Down
8 changes: 7 additions & 1 deletion lib/ro/model.rb
Expand Up @@ -47,7 +47,7 @@ def Model.paginate(*args, &block)
def Model.models_for(result)
case result
when Array
Array(result).flatten.compact.map{|attributes| new(attributes)}
Array(result).flatten.compact.map{|element| new(element)}
else
new(result)
end
Expand All @@ -60,6 +60,12 @@ def initialize(*args, &block)
attributes = Map.options_for!(args)

node = args.detect{|arg| arg.is_a?(Node)}
model = args.detect{|arg| arg.is_a?(Model)}

if node.nil? and not model.nil?
node = model.node
end

if node
@node = node
else
Expand Down

0 comments on commit 68ef898

Please sign in to comment.