Fix queries when the condition is nil.
Add options hash on query.
Refactor query and has_many methods.
Merge pull request #3 from ionia-corporation/fix_queries

Fix queries