Releases: PhilWaldmann/openrecord
fixes a context bug with relations
v1.6.2 fixes a context bug with relations
LDAP Support!!
Openrecord is able to talk to your ldap server.
Full activedirectory support will follow soon!
Some knex bugfixes
v1.5.4 some small bugfixes + additional tests
Bugfixes
v1.5.3 bugfixes
Time Bugfix
Fixes a bug in the time
datatype of postgres and mysql
knex Update + cross-store relations
Cross-Store relations by example:
store1 = new Store({
//...config...
name: "Store1"
});
store2 = new Store({
//...config...
name: 'Store2'
});
store1.Model('User', function(){
this.belongsTo('user', {store: 'Store2', primary_key:'id'});
});
store2.Model('User', function(){
});
var User = store1.model('User');
User.include('user').exec(....)
More bugfixes
v1.4.5 bump version
Lot of bugfixes
v1.4.4 postgres hstore bugfix
Bugfixes, Converter, Temporary Definition
Convert
It's now possible to convert every input, output, read or write value
example model definition:
module.exports = function(){
this.convertOutput('login', function(value){
return value + '-foo'; //append '-foo' to the login attribute.
});
}
The convertOutput
method will be called on every toJson()
call.
Only the resulting json object will have the converted value.
There are currently 4 convert methods available:
convertInput
: will be called onset()
or on assignmentsrecords.login = 'phil';
convertOutput
: will be called ontoJson()
convertRead
: will be called while reading data from the databaseconvertWrite
: will be called while writing to the database
Temporary Definition
The method temporaryDefinition()
will create a temporary definition object for you.
here is an example:
module.exports = function(){
this.scope('combine_name', function(){
this.temporaryDefinition()
.attribute('full_name', String)
.convertOutput('full_name', function(){
//we don't need the value here
return this.first_name + ' ' + this.last_name;
});
});
}
in the above example we create a scope combine_name
. Only if you call the scope:
YourModel.combine_name().exec(...)
you will receive the extra field full_name
on every record.
If you just call
YourModel.exec(...)
you won't receive the full_name
attribute.
Now you could add/change Hooks, validations, converters, attributes and more - temporarily.
logger config option + bugfixes
It's now possible to define your own logger.
Just set the logger
option to the logger class in your store config.