Major Changes:
Major Changes:
- Moved association option
collection
tocollectionName
- Introduced String#demodulize
- Modified Model#paramRoot to demodulize
Viking.Model::modelName
is nowViking.Model::name
and returns an object with various nameing conventions.Model::coercions
andModel::defaults
is nowModel::schema
- moved
Viking.AssociationReflection
toViking.Model.Reflection
and friends - Added
Viking.Model.HasAndBelongsToManyReflection
- added
Viking.View.bindEl
- abstract models for
Viking.Model
can now be created connection
can be set to route ajax calls to a specific serverViking.Model#touch
just updates the timestamps viaPATCH
instead of aGET
to/model/id/touch
Minor Changes:
Viking.Support#toParam
now support passingnull
Viking.Model.create
now passes options correctly to save
Bugfixes:
- Fixed issue with
Viking.View.Helpers.distanceOfTimeInWords
and future dates Viking.Model::urlRoot
now obeys customurlRoot
s set in a Model
Major Changes:
- added
Viking.View
- extending a
Viking.View
merge events together - added template support to
Viking.View
viarenderTemplate
- added support for
hasMany
relationships inFormBuilder.fieldsFor
- setting a
belongsTo
relation ship set/unsets the corresponding foreign_key - added
Viking.Model.create
andViking.Model.findOrCreateBy
Minor Changes:
Viking.Model.unset
now allows you to unset ahasMany
relationshipViking.FormBuilder
now uses the baseModel for the name for use with STI modelsViking.FormBuilder#fieldsFor
now uses the baseModel for the name for use with STI models- JSON data type sets the
baseModel
to itself - added
imageTag
toViking.View
helpers - added
render
toViking.View
helpers FormBuilder.fieldsFor
accepts a model, collection, or array of recordsViking.Controller
now hascontrollerName
Bugfixes:
- Fixed issue with custom name attribute on
Viking.View.Helpers.textField
- Fixed issue with custom name attribute on
Viking.View.Helpers.select
- Fixed checkBox not having an escape option
Major Changes:
- added
Viking.View.Helpers::mailTo
url helper Viking.Collection#order
now takes(order, options)
Viking.Collection#order
now callsViking.Collection#orderChanged
when changedViking.sync
added, converts objects via.toParam()
as opposed to letting jQuery use$.param()
Viking.Model
andViking.Collection
now useViking.sync
- global
urlFor
helper added Viking.View.Helpers.linkTo
helper addedViking.Model.coercions
now supportsArray
data types via options- Added
CheckBoxGroupBuilder
andViking.View.checkBoxGroup
- Added
FromBuilder#checkBoxGroup
helper
Minor Changes:
Viking.Coercions.Number.load
now coerces an empty string tonull
Bugfixes:
Viking.View.Helpers::labelTag
now accepts theescape
paramaterViking.View.Helpers::label
now accepts theescape
paramater
Major Changes:
FormBuilder
no longer accepts content as an argumentFormBuilder#render
has been removedViking.Viking.Helpers.formFor
is now responsible for output theform
tags- Added
FormBuilder.fieldsFor
that acts similar to Rail's fields_for - Added array type coercion
- Added inital support for polymorphic belongsTo associations in
Viking.Model
Minor Changes:
Viking.Model#set
now changes the prototype of the model to type if type was passedViking.Model#set
initializes newhasMany
associations when set is called with new type- Added
Viking.View.Helpers.timeTag
- All form helpers allow the name to be passed in as an option to override the generated name
Viking.View.tagNameForModelAttribute
now accepts namespace as an option- setting
inheritanceAttribute = false
on a Model disableds STI - added
Viking.View.Helpers.numberField
andViking.View.Helpers.numberFieldTag
helpers - JSON data type coercions now allows the key
type
Bugfixes:
Router#start
now takesoptions
and passes them toBackbone.history.start
Model#paramRoot
returns thebaseModel.modelName
when used with STIArray.toParam
andArray.toQuery
no longer show up in array iterators- if default
type
set on an STI model, initializes with that model - Fixed issue when using STI and changing
type
themodelName
was not being updated
New Features:
- added
FormBuilder
helper - added
Viking.View.Helpers.formFor
helper for creating and renderingFormBuilder
s
Bugfixes:
belongsTo: ['api_key']
assumesApiKey
is the class notApi_key
Major Changes:
- Inital support for STI
Viking.Model#url
now uses#toParam
to get the objects key for the url- Removed CSRF token injection for AJAX request. Can added on a per project basis
Minor Changes:
updateAttribute
&updateAttributes
moved fromBackbone.Model
toViking.Model
Major Changes:
- Added
Viking.View.Helpers
to make rendering forms in templates easier. - Removed
Viking.View
, was not being used
Minor Changes:
- Updated to test against Backbone v1.1.2, jQuery v2.1.0, & Underscore.js 1.4.4
New Features:
- Added a
::where(query)
function to Model. Returns a unfetched collection with the predicate set to the query - Adding coercions for data types
- Replaced
#save
to set errors if returned in the save - Added
#setErrors
function. - Added
String#ljust
andString#rjust
toViking.Support
- Added
Viking.Model#touch
- Added
toParam
andtoQuery
methods
Major Changes:
hasMany
collections are no longer replace but merged when set on a modelViking.Model#select
method signature has changed
Minor Changes:
Viking.Model#select
now works when the model isn't part of a collection
New Features:
Viking.Model
: added#unselect
methodViking.Router
: added support for regex routesViking.View
: aBackbone.View
that inherits both events and initializers
Major Changes:
Viking.Model
:#select
now usesmodel.select
instead of model attributesViking.Controller
: AnyViking.Controller
is now initialized and then the action is called. When routing to a new URL, if it is the same controller the new action is called but the controller is not reinitialized. When routing to another URL that is not using the controller and then back, the controller is initialized again. Also the current controller object is stored inViking.controller
Bugfixes:
Viking.Model
: Better support in older browsers for parsing ISO8601 datesViking.Router
: Delayed the loading of the route callback untilroute
is called. Allows Controllers and functions to be be loaded after the router.Viking.PaginatedCollection
: ifoffset
is not included in a paginated response it's ignored. it was causing the inital request to load twice.
Inital Release!