RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: efries
also just do a migration for hstore:
execute "CREATE EXTENSION hstore"
execute "DROP EXTENSION hstore"
config.active_record.schema_format = :sql
helped to run minitest with hstore
i will learn ember.js :)
btw, anyone having this?
$ rake db:test:prepare
PG::Error: ERROR: type "hstore" does not exist
LINE 1: ...te, "tags" character varying(255), "properties" hstore, "c...
still didn't found a way to do it, but the multi tenancy casts are a great help to succeed with my goals.
thanks so much to ryan for all the great episodes!
there are several ways, look at this:
and you should take a look to authorisation from scratch. it works perfectly for me,
but i'm still very interested to see what cancan2 will bring :)
Permissions.permission_for(user) shows nearly what i'm looking for, but it doesn't work for the index action where a the customer_id matches.
allow_action :cabinets, [ :index, :new, :create, :edit, :update ] do |cabinet|
cabinet.customer_id == user.customer_id
any ideas how to implement the accessible_by for the index action?
like with cancan:
@projects = Project.accessible_by(current_ability)
# This module adds the accessible_by class method to a model. It is included in the model adapters.
# An alternative action can optionally be passed as a second argument.
# @articles = Article.accessible_by(current_ability, :update)
# Here only the articles which the user can update are returned.
def accessible_by(ability, action = :index)