Skip to content

Commit

Permalink
Merge pull request maxdemarzi#40 from blizkreeg/models
Browse files Browse the repository at this point in the history
a few fixes
  • Loading branch information
kamranjon committed Sep 17, 2013
2 parents fefedaf + 74e2af9 commit 1a976e4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/deja/node.rb
Expand Up @@ -40,7 +40,7 @@ def initialize(*args)
def define_alias_methods(rel, aliases)
self.class_eval do
define_method aliases[:out_plural] do |filter = nil|
r = send(:related_nodes, {:include => rel, :direction => :out, :filter => filter})
send(:related_nodes, {:include => rel, :direction => :out, :filter => filter})
instance_variable_get("@#{rel}")
end

Expand Down
4 changes: 1 addition & 3 deletions lib/deja/schema_generator.rb
Expand Up @@ -28,7 +28,7 @@ def attribute(name, type, opts = {})
def attr_accessorize(name, opts)
send(:attr_reader, name)
define_method("#{name}=") do |new_value|
send("#{name}_will_change!") if (new_value != instance_variable_get("@#{name}") && opts[:index])
send("#{name}_will_change!") if (new_value != instance_variable_get("@#{name}") && !instance_variable_get("@#{name}").nil? && opts[:index])
instance_variable_set("@#{name}", new_value)
end
end
Expand All @@ -45,8 +45,6 @@ def create_index_methods(key, values = nil, unique = false)
define_method("remove_#{key}_from_index") do
self.remove_from_index("idx_#{self.class.name}", key, send(key))
end
private("add_#{key}_to_index")
private("remove_#{key}_from_index")
end

def index(name, attrs, opts = {})
Expand Down

0 comments on commit 1a976e4

Please sign in to comment.