GitXplorerGitXplorer
j

acts_as_applyable

public
3 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
85aacf1585dd3b7bb09dd61e4e8784e8674428b0

Fixing up the default applyable fields

jjcnetdev committed 16 years ago
Unverified
fd272f1b19463a2e3446111f0e3431fcc0b5daf9

Removing retarded meta programming bullshit

jjcnetdev committed 16 years ago
Unverified
7689b11343e3553ee1ce97b3d63c4442066e242a

Fixing metaprogramming

jjcnetdev committed 16 years ago
Unverified
4eb95b2885bd101424d8964371758b38d9c3160c

Fixing Major Issue with breaking .attributes method

jjcnetdev committed 16 years ago
Unverified
f5622877b597f8efb6ec0d077cf8dacec9d220ca

Applying plugin to all active record models

jjcnetdev committed 16 years ago
Unverified
9786c7ad1ecd5ae4a739b7552411471bafd889e7

v0.1. Checking in first working build

jjcnetdev committed 16 years ago

README

The README file for this repository.

ActsAsApplyable

acts_as_applyable is a Rails plugin that allows you to ditch attr_accessible and attr_protected, in favor of a cleaner way of dealing with mass assignment

Example

Old way: @user = User.new(params[:user]) @user.save

New way: @user = User.new @user.params = params[:user] @user.apply(:username, :email, :password, :password_confirmation)

In order to enable it, run this on your model

If you want to act similar to attr_accessible, you can define a method called applyable_attributes that returns the array of fields you want to appy by default.

def applyable_fields [:name, :email, :password] end

that way you can run @user.apply and it will use these

Copyright (c) 2008 RailsJedi.com, released under the MIT license