apidock.com Archives - 22 December 2014, Monday

  • serialize (ActiveRecord::Base)

    apidock.com 25 Oct '14, 10pm

    If you have an attribute that needs to be saved to the database as an object, and retrieved as the same object, then specify the name of that attribute using this method and it will be handled automatically. The serialization is done through YAML . If class_name is specified, the seri...

  • memoize (ActiveSupport::Memoizable)

    apidock.com 27 Sep '14, 6pm

    # include InstanceMethods # if method_defined?(:#{original_method}) # if method_defined?(:_unmemoized_mime_type) raise "Already memoized #{symbol}" # raise "Already memoized mime_type" end # end alias #{original_method} #{symbol} # alias _unmemoized_mime_type mime_type # if instance_m...

  • crypt (String)

    apidock.com 02 Aug '14, 4pm

    From the man page: If salt is a character string starting with the characters “$id$” followed by a string terminated by “$”: $id$salt$encrypted then instead of using the DES machine, id identifies the encryption method used and this then determines how the rest of the password string ...

  • has_many (ActiveRecord::Associations::ClassMethods)

    apidock.com 27 Jul '14, 7am

    Specifies an association through which to perform the query. This can be any other type of association, including other :through associations. Options for :class_name, :primary_key and :foreign_key are ignored, as the association uses the source reflection. If the association on the j...

  • const_set (Module)

    apidock.com 03 Jul '14, 9pm

    Sets the named constant to the given object, returning that object. Creates a new constant if no constant with the given

  • (ActiveResource::Base)

    apidock.com 27 Jun '14, 4pm

    for equality. Resource are equal if and only if other is the same object or is an instance of the same class, is not

  • url_for (ActionView::Helpers::UrlHelper)

    apidock.com 09 Jun '14, 7am

    Specify :host option in emails Emails need a fully qualified URL (with domain). Use the :host parameter. But note also that you need to specify a value that is not dependent upon the request context. http://api.rubyonrails.org/classes/ActionMailer/Base.html recommends setting a defaul...

  • in_groups_of (Array)

    apidock.com 30 May '14, 2pm

    Splits or iterates over the array in groups of size number, padding any remaining slots with

  • layout (AbstractController::Layouts::ClassMethods)

    apidock.com 26 May '14, 8am

    Specify the layout to use for this class. If the specified layout is a: String the String is the template name Symbol call the method specified by the symbol, which will return the template name false There is no layout true raise an ArgumentError nil Force default layout behavior wit...

  • define_method (Module)

    apidock.com 24 May '14, 10pm

    Defines an instance method in the receiver. The method parameter can be a Proc, a Method or an UnboundMethod object. If a block is specified, it is used as the method body. This block is evaluated using instance_eval, a point that is tricky to demonstrate because define_method is priv...

  • validates_with (ActiveModel::Validations::ClassMethods)

    apidock.com 20 May '14, 4am

    :on - Specifies when this validation is active (:create or :update . :if - Specifies a method, proc or string to call to determine if the validation should occur (e.g. if: :allow_validation, or if: Proc.new { |user| user.signup_step > 2 } ). The method, proc or string should return or...

  • syswrite (IO)

    apidock.com 16 May '14, 7am

    written. Do not mix with other methods that write to ios or you may get unpredictable results. Raises

  • inheritance_column (ActiveRecord::ModelSchema::ClassMethods)

    apidock.com 28 Apr '14, 9am

    Defines the name of the table column which will store the class name on single-table inheritance situations. The default inheritance column name is type, which means it’s a reserved word inside Active Record . To be able to use single-table inheritance with another column name, or to ...

  • alias_attribute (Module)

    apidock.com 19 Apr '14, 4pm

    Deprecated - replacement method The description rightly lists this as deprecated, but using it will still work atm, as it seems to have moved to ActiveSupport::CoreExtensions::Module instead. So your code should still work.

  • destroyed? (ActiveRecord::Persistence)

    apidock.com 16 Apr '14, 4am

    Returns true if this object has been destroyed, otherwise returns false. Show source # File activerecord/lib/active_record/persistence.rb, line 77 def destroyed? sync_with_transaction_state @destroyed end

  • to_query (ActiveSupport::CoreExtensions::Hash)

    apidock.com 11 Apr '14, 9am

    This method is deprecated or moved on the latest stable version. The last existing version (v2.3.8) is shown here. These similar methods exist in v4.0.2: Object#to_query Array#to_query Hash#to_query

  • __callee__ (Kernel)

    apidock.com 08 Apr '14, 11am

    __callee__ and __method__ both return symbol when originally defined, not current There has been some indication that __callee__ is intended to return the symbol with which the method was actually invoked, whereas __method__ returns name with which the method was originally defined, b...

  • create (ActiveRecord::Base)

    apidock.com 04 Apr '14, 8pm

    This method is deprecated or moved on the latest stable version. The last existing version (v3.1.0) is shown here. These similar methods exist in v4.0.2: ActiveRecord::Relation#create ActiveRecord::ConnectionAdapters::MysqlAdapter#create ActiveSupport::TimeZone#create ActiveRecord::As...

  • size (Fixnum)

    apidock.com 24 Mar '14, 8pm

    in the machine representation of a

  • attr_accessor (Module)

    apidock.com 18 Mar '14, 12pm

    Defines a named attribute for this module, where the name is symbol. id2name, creating an instance variable (@name ) and a corresponding access method to read it. Also creates a method called name= to set the attribute.

  • strftime (DateTime)

    apidock.com 08 Mar '14, 12pm

    m blank-padded ( 1..12) %-m no-padded (1..12) %B - The full month name (``January'') %^B uppercased (``JANUARY'') %b - The abbreviated month name (``Jan'') %^b uppercased (``JAN'') %h - Equivalent to %b %d - Day of the month, zero-padded (01..31) %-d no-padded (1..31) %e - Day of the ...

  • ERB

    apidock.com 06 Mar '14, 1pm

    ) returns a string in the same character encoding as the input string. When the input string has a magic comment, however, it returns a string in the encoding specified by the magic comment.

  • find_in_batches (ActiveRecord::Batches)

    apidock.com 03 Mar '14, 10am

    You can control the starting point for the batch processing by supplying the :start option. This is especially useful if you want multiple workers dealing with the same processing queue. You can make worker 1 handle all the records between id 0 and 10,000 and worker 2 handle from 10,0...

  • touch (ActiveRecord::Persistence)

    apidock.com 27 Feb '14, 7pm

    Saves the record with the updated_at/on attributes set to the current time. Please note that no validation is performed and only the after_touch callback is executed. If an attribute name is passed, that attribute is updated along with updated_at/on attributes.

  • current_time_from_proper_timezone (ActiveRecord::Timestamp)

    apidock.com 27 Feb '14, 7pm

    current_time_from_proper_timezone () private No documentation This method has no description. You can help the Ruby on Rails community by adding new notes. Hide source # File activerecord/lib/active_record/timestamp.rb, line 107 def current_time_from_proper_timezone self . class . def...

  • authenticate_or_request_with_http_token (ActionController::HttpAuthentication::Token::ControllerMethods)

    apidock.com 21 Feb '14, 11pm

    authenticate_or_request_with_http_token (realm = "Application", &login_procedure) public No documentation This method has no description. You can help the Ruby on Rails community by adding new notes. Show source # File actionpack/lib/action_controller/metal/http_authentication.rb, lin...

  • respond_with (ActionController::MimeResponds)

    apidock.com 17 Feb '14, 1am

    can play two roles. It can be used to generate the redirect url for successful html requests (e.g. for create actions when no template exists), while for formats other than html and javascript it is the object that gets rendered, by being converted directly to the required format (aga...

  • wrap (Array)

    apidock.com 16 Feb '14, 2pm

    If the argument responds to to_ary the method is invoked. Kernel#Array moves on to try to_a if the returned value is nil, but Array.wrap returns nil right away. If the returned value from to_ary is neither nil nor an Array object, Kernel#Array raises an exception, while Array.wrap doe...

  • forty_two (Array)

    apidock.com 11 Feb '14, 4pm

    Equal to self[41] . Also known as accessing “the reddit”. Show source # File activesupport/lib/active_support/core_ext/array/access.rb, line 51 def forty_two self [ 41 ] end

  • Proxy (Net::HTTP)

    apidock.com 09 Feb '14, 10pm

    The arguments are the DNS name or IP address of the proxy host, the port to use to access the proxy, and a username and password if authorization is required to use the proxy.