Skip to content

Commit

Permalink
Fix bug in the update of records with custom primary_keys
Browse files Browse the repository at this point in the history
The previous code would result in this error:
NoMethodError Exception: undefined method `find_all_by_id' for #<Class...
  • Loading branch information
davide committed Jul 30, 2012
1 parent eda96c8 commit 7a2a73d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/netzke/basepack/data_adapters/active_record_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def destroy(ids)
end

def find_record(id)
@model_class.find_all_by_id(id).first
@model_class.where(@model_class.primary_key => id).first
end

# Build a hash of foreign keys and the associated model
Expand Down

0 comments on commit 7a2a73d

Please sign in to comment.