This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class DeviseCreateUsers < ActiveRecord::Migration | |
| def change | |
| create_table(:users) do |t| | |
| ## Database authenticatable | |
| t.string :username, :null => false, :default => "" | |
| t.string :email, :null => false, :default => "" | |
| t.string :encrypted_password, :null => false, :default => "" | |
| ## Recoverable | |
| t.string :reset_password_token |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class User < ActiveRecord::Base | |
| protection_strategy :whitelist do | |
| only :first_name, :last_name, :login, :password, :password_confirmation | |
| end | |
| protection_strategy :blacklist do | |
| except :encrypted_password | |
| end | |
| end | |
| u = User.new({protected_attribute: "blah", first_name: "John"}, filter: :whitelist) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'ruby-debug' | |
| require 'spira' | |
| require 'rdf/rdfxml' | |
| require 'sparql/client' | |
| class Actor | |
| include Spira::Resource |