github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

carlosbrando / remarkable

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 390
    • 29
  • Source
  • Commits
  • Network (29)
  • Issues (7)
  • Downloads (4)
  • Wiki (5)
  • Graphs
  • Tree: 136267f

click here to add a description

click here to add a homepage

  • Branches (2)
    • 2.3-stable
    • master
  • Tags (4)
    • 2.3.1
    • 2.2.4
    • 2.1.7
    • 2.1.1
Sending Request…
Click here to lend your support to: remarkable and make a donation at www.pledgie.com ! Edit Pledgie Setup

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Simplifying tests! — Read more

  cancel

http://www.nomedojogo.com/category/remarkable/

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Show version when releasing files. 
josevalim (author)
Mon Apr 13 02:52:19 -0700 2009
commit  136267fbd66be4892db6f3b561cab650f3f7b935
tree    484a00f83356192b4b7c9147afbae8e8d2f32314
parent  8bc2474730061a8183d965480088517659f54408
remarkable / remarkable_activerecord / lib / remarkable_activerecord / matchers / allow_mass_assignment_of_matcher.rb remarkable_activerecord/lib/remarkable_activerecord/matchers/allow_mass_assignment_of_matcher.rb
100644 35 lines (29 sloc) 1.025 kb
edit raw blame history
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
module Remarkable
  module ActiveRecord
    module Matchers
      class AllowMassAssignmentOfMatcher < Remarkable::ActiveRecord::Base #:nodoc:
        arguments :collection => :attributes, :as => :attribute
 
        collection_assertions :is_protected?, :is_accessible?
 
        protected
 
          def is_protected?
            protected = subject_class.protected_attributes || []
            protected.empty? || !protected.include?(@attribute.to_s)
          end
 
          def is_accessible?
            accessible = subject_class.accessible_attributes || []
            accessible.empty? || accessible.include?(@attribute.to_s)
          end
      end
 
      # Ensures that the attribute can be set on mass update.
      #
      # == Examples
      #
      # should_allow_mass_assignment_of :email, :name
      # it { should allow_mass_assignment_of(:email, :name) }
      #
      def allow_mass_assignment_of(*attributes)
        AllowMassAssignmentOfMatcher.new(*attributes).spec(self)
      end
    end
  end
end
 
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server