Displaying 20 results from an estimated 2311 matches for "shop".
Did you mean:
ship
2009 Mar 25
11
ActiveRecord: Nested :include erroneous behavior
...2.0. This
example illustrates the usage of nested :include finder options.
class Book < ActiveRecord::Base
has_many :distributors
end
class Distributor < ActiveRecord::Base
belongs_to :book
has_many :agents
end
class Agent < ActiveRecord::Base
belongs_to :distributor
has_many :shops
end
class Shop < ActiveRecord::Base
belongs_to :agent
end
Schema - http://pastie.org/426261
def test_should_load_avatars
shop_1= Shop.create!
shop_2= Shop.create!
book= Book.create!(:distributors => [Distributor.create!(:agents=>
[Agent.create!(:shops => [shop_2, shop_2])])]...
2012 Aug 17
3
Rails doesn't validate create_model or build_model (has_one association)
I''ve got User has_one Shop. Rails is not validating when I tried
create_shop or build_shop, neither in the browser nor the rails console.
My code:
class Shop < ActiveRecord::Base
attr_protected :user_id
belongs_to :user
validates_presence_of :name, :primary_address, :city, :country_code,
:currency
end
class Shops...
2006 Feb 07
3
help with relationship
Let''s imagine we are modelling a company that have several shops. I
have a Worker model and a Shop model. A worker belongs_to a shop, and
each shop has_many workers. But, in a shop there''s a distinguished
worker that is the supervisor
create table shops (
...
worker_id integer -- the supervisor
);
How would you expre...
2005 Nov 28
1
has_one / HABTM relationship overlap - please advise
1. I have a few tables: ''users'', ''shops'', ''addresses'', and ''pictures''.
2. Users and Shops will both use the addresses and pictures tables. I have
created several mapping tables:
addresses_shops
pictures_shops
addresses_users
pictures_users
3. Users CAN have many addresses and pictures (si...
2012 Apr 27
4
Is my developer dodgy?
Hi!
I need some help, my partner and I have hired an app development
company to create an iPhone app that allows shops to list their
inventory and advertise their specials, there is also a back end admin
website that shop owners can login to that allows them to update their
inventory and specials. The admin website communicates directly with
the iPhone app so that any changes made are shown on the app, pretty
much...
2011 Sep 01
0
do you think it's the best solution?
I have:
class Shop < ActiveRecord::Base
has_many :documents, :dependent => :restrict
has_many :roles, :dependent => :restrict
accepts_nested_attributes_for :documents
accepts_nested_attributes_for :roles
the shop _form is:
= simple_form_for(@shop) do |shop_f|
= render ''shared/error_messages...
2011 Sep 15
1
bypass defualt scope.
class Shop < ActiveRecord::Base
has_many :documents, :dependent => :restrict
end
class Document < ActiveRecord::Base
belongs_to :shop
default_scope :order => ''updated_at DESC''
end
in the Shop show view I have:
- for document in @shop.documents
%li(id="shop_document...
2006 Apr 04
2
Foreign keys not showing!
I''m new at this so please be patient.
I have a very simple schema consisting of a around 10 tables in
Postgresql. The aim is to provide a system for PC administrators to
keep track of PC''s dotted around various venues (shops, libraries
etc.). The sort of info I want to store is PC specs, PC network specs,
PC ownership specs, PC location specs and contact person details. So I
end up with a few tables associated with one another through foreign
keys and join tables. Two of the tables, for example, are created
with (node...
2012 Oct 16
2
unique
Hello everybody,
I've got a problem concerning the function unique. I have got a
data.frame "shopdata" with 1000 shop which were evaluated at different
points in time.
With function subset I chose those shops with more then 10 employee and
store it in data.frame "bigshopdata" with 700 shops.
bigshopdata=subset(shopdata, shopdata$employee>10)
Now I use unique(bigshopdata$...
2006 Feb 18
3
scoped databases need explanation...
...oft.com/articles/2005/10/31/scoped-databases
in a way that can be understood with an example if possible. Tobi Lutke
has started to explain but it does not make any sense.
"Since rails 0.13.1 we support calling class methods over associations."
what?? give an example.
also
"The Shop object is figured out at the beginning of each request by
looking at the incoming domain of the user." has no example of how it
could be used.
I feel this is a very important aspect to rails that needs some futher
explanation.
--
Posted via http://www.ruby-forum.com/.
2006 Jun 22
4
Shop plugin?
I hope I''m not completely off-base here but is there a shop plugin for
ruby/rails that means I don''t have to write the code for a shop from
scratch? Can''t seem to find one...
Thanks!
Bex
--
Posted via http://www.ruby-forum.com/.
2009 Jan 29
1
Problem compiling 3.3.0?
...ror, please notify the sender immediately and delete this email from your system. You must take no action based on this email, nor must you copy or disclose it or any part of its contents to any person or organisation. Please note that email communications may be monitored. The registered office of Shop Direct Limited is First Floor, Skyways House, Speke Road, Speke, Liverpool, L70 1AB, registered number 04730752.
Subsidiary companies of Shop Direct Limited include:
Shop Direct Group Financial Services Limited (SDGFS), Shop Direct Financial Services Limited (SDFS) and Shop Direct Finance Compan...
2011 Jul 14
1
RoutingError with RSpec Controller test on Scoped Route
So I have a route that looks like this:
scope "4" do
scope "public" do
scope ":apikey" do
resources :shops
end
end
end
And a bunch of controller specs, an example of which looks like this:
describe ShopsController do
describe "when responding to a GET" do
context "#new" do
it "should create a new instance of the shop class" do
get :new...
2013 Nov 15
0
gpo not working
...)
some data for have an idea on scene
#samba -V
Version 4.2.0pre1-GIT-UNKNOWN
#uname -a
Linux dc 2.6.32-20-pve #1 SMP Wed May 15 08:23:27 CEST 2013 i686 GNU/Linux
#samba-tool gpo listall
GPO : {31B2F340-016D-11D2-945F-00C04FB984F9}
display name : Default Domain Policy
path :
\\shop.zone.example.com\sysvol\shop.zone.example.com\Policies\{31B2F340-016D-11D2-945F-00C04FB984F9}
dn :
CN={31B2F340-016D-11D2-945F-00C04FB984F9},CN=Policies,CN=System,DC=shop,DC=zone,DC=example,DC=com
version : 0
flags : NONE
GPO : {6AC1786C-016F-11D2-945F-00C04FB984F9}...
2010 Jan 20
0
How to map a Named Route onto a namespaced resource?
I have a site, where I am currently adding a self-built shop.
Among other stuff I have this construction in my route-file
map.namespace :shop do |shop|
shop.resources :categories do |categories|
categories.resources :products
end
end
I like the namespace, since it encapsulates the shop nicely inside my
webapplication.
Somehow I would like the url...
2008 Jan 10
1
data.frame manipulation: Unbinding strings in a row
Hi all,
I have a data.frame I received with data that look like this (comma
separated strings in last row):
ID Shop Items
ID1 A1 item1, item2, item3
ID2 A2 item4, item5
ID3 A1 item1, item3, item4
But I would like to unbind the strings in col(2) items so that it will look
like this:
ID Shop Items
ID1 A1 item1
ID1 A1 item2
ID1 A1 item3
ID2 A2 item4
ID2 A2 item5
ID3 A1 item1
ID3 A1 item3
ID3 A1 item4
Meaning ea...
2006 Mar 07
4
should a AR object be able to see backwards?
I have two models, Stop and Station, they relate one station to many
stops.
Stop has_one :station
Station belongs_to :stop
So I can do @station.stops, but I cant do @stop.station, is this right?
For example in the view I have:
<% for @stop in @stops %>
<tr>
<td><%= @stop.station.name %></td>
<td><%= @stop.time.hour.to_s + '':''
2007 Aug 17
1
Need volunteers for new Rails based shopping cart
We''re currently looking for volunteers on the new RailsCart[1]
project. The idea is to build something relatively simple with all of
the features that most open source shopping carts seem to be missing.
We''ll be using ActiveMerchant for all of our payment gateway needs.
We''re not trying to build the ultimate shopping cart. This is
designed for Rails developers who need to slide a shopping cart into
their websites. The project is still evolving so f...
2006 Mar 07
11
maintaining application state/urls
Hi All
Not specifically a scriptaculous question, but I was wondering how
people were going about maintaining access to their applications via
standard urls.
Say for example I''ve a shop at www.shop.com, and its pure ajax to load
in products. Now customer A wants to show a friend a product on the site
- giving him the url www.shop.com and telling him to click on a series
of links seems clunky. So what I''d like to do is for my ajax app (no its
not a shop thats just an e...
2008 Jun 16
3
Apache rewrites with mongrel
...cripts
RewriteLog /var/log/apache2/rails-rewrite.log
And last not lease my .htaccess in public
AddHandler fastcgi-script .fcgi
AddHandler cgi-script .cgi
Options +FollowSymLinks +ExecCGI
AddDefaultCharset UTF-8
RewriteEngine On
RewriteRule ^01,([0-9]*).html$ balancer://mongrel_cluster/shop/event/$1
[P,QSA,L]
RewriteRule ^01,([a-zA-Z0-9]*),([0-9]+).html$
balancer://mongrel_cluster/shop/search/$2?startnumber=$1 [P,L]
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
the rewrite for static-s...