- Next feature description here
- Begin migration to Sequel for
Query::Sql
.#_execute
uses it for a database-agnostic adapter for running raw SQL.#_multi_get
uses it generate a datbase-agnostic where clause
- Added accessor generation for
one_to_many
associations in resources. - Imported
Model
extensions for FactoryGirl topraxis-mapper/support/factory_girl
. - This also adds
IdentityMap#persist!
to insert all rows in the identity map into the database. - Added
SchemaDumper
andSchemaLoader
for dumping and loading schema information inpraxis-mapper/support/schema_dumper
andpraxis-mapper/support/schema_loader
respectively. IdentityMap#all
now accepts non-identity keys as conditions, and will create a secondary index for the key the first time it's queried.- Added
Model#identities
to get a hash of identities and values for a record. - Auto-generated attribute accessors on
Blueprint
do not load (coerce) the value using the attribute. Ensure values passed in already have the appropriate types. Blueprint attributes will still be wrapped properly, however. - Performance and memory use optimizations.
IdentityMap#load
now supports eagerly-loading associated records in a query, and supports the full set of options on the inner query, including- Tracked
:one_to_many
associations now support where clauses. Usingwhere
clauses when tracking other association types is not supported and will raise an exception.
- Moved Blueprint inner attribute creation to finalize!
- Added :dsl_compiler and :identity as valid options for Blueprint.
Praxis::Mapper::Model
Model.context
allows named query parameters to be reused across queries. See documentation for details.Model#_query
references original query that loaded the record.Model.serialized_fields
returns hash of fields defined with eitherjson
oryaml
directives as serialized fields.- Fixed accessors will to raise
KeyError
if the record does not the field (i.e., if it was not loaded from the database), rather than silently returningnil
.
Praxis::Mapper::Query
:- Multiple
select
andtrack
calls within one query are now additive. track
option now takes a block that will be applied to the query used to load the tracked records.context
directive to apply the named context from the model to the query. See documentation for more.
- Multiple
Praxis::Mapper::IdentityMap
- Removed
:track
option from#add_records
in favor of usingModel#_query
to determine tracked associations.
- Removed
- Added
Praxis::Mapper::Support
withMemoryQuery
andMemoryRepository
for use in testing data loading without requiring a database.
The Model
accessor changes may break existing applications that (incorrectly) expect unloaded attributes to return nil
.
- Blueprint.validate now only accepts objects of the its type.
- Improved handling of Blueprints with circular relations.
- First pass at reworking model associations.
- Split
belongs_to
intomany_to_one
andarray_to_many
associations - Added
one_to_many
andmany_to_array
associations (the inverse of the above associations, aka: has_many) - Added association configuration DSL to replace previous hash-based configuration.
- Split
- Added support for code coverage
- Added support for 'guard' gem (use 'bundle exec guard')
- Fixed bug in Praxis::Mapper::Model.undefine_data_accessors when method doesn't exist.
- Safer version checking with Gem::Version class
- Cleaned up Gemfile
- Updated 'slop' gem
- identity map hotfix
- don't know what happened here, check git log I guess
- initial release